diff options
| author | Michael Forney <mforney@mforney.org> | 2019-03-27 19:51:04 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2019-03-27 19:58:07 -0700 |
| commit | 0e291a9ff5aef406d53b5a324356fc77ddd4b8e7 (patch) | |
| tree | ea8d2218a4b6c1b8c8542281462c3c4dde9a2244 /src | |
| parent | 9538308a9b30aa138781607a4cc01d84233164fb (diff) | |
applyperms: Print when removing directories
Also, make sure to remove them relative to rootfd.
Diffstat (limited to 'src')
| -rw-r--r-- | src/applyperms.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/applyperms.c b/src/applyperms.c index b5c10aa2..f21ee4b9 100644 --- a/src/applyperms.c +++ b/src/applyperms.c @@ -174,6 +174,13 @@ mkdir_v(const char *path, mode_t mode) } static int +rmdir_v(const char *path) +{ + printf("rmdir(\"%s\")\n", path); + return unlinkat(rootfd, path, AT_REMOVEDIR); +} + +static int defperm(const char *name) { struct stat st; @@ -265,7 +272,7 @@ specialperms(void) /* delete directories in reverse order */ while (i > 0) { --i; - if (oldsp.perms[i].delete && rmdir(oldsp.perms[i].name) < 0) { + if (oldsp.perms[i].delete && rmdir_v(oldsp.perms[i].name) < 0) { switch (errno) { case ENOENT: case ENOTEMPTY: |
