From 3943d22e67d7944123b31cfed18c3bb64670efd2 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 25 Dec 2024 12:46:27 +0900 Subject: [PATCH] Force set dir permissions when specified The previous behavior refused to set `write` for `group` and `other` when setting directory permissions. This commit changes this so that when permissions are specified, then the directory is `chmod`d after its creation. --- src/helpers.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/helpers.c b/src/helpers.c index 4a10a0e..4d8d88c 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -260,6 +260,11 @@ int simple_archiver_helper_make_dirs_perms(const char *file_path, // Error. return 2; } + ret = chmod(dir, perms); + if (ret != 0) { + // Error. + return 5; + } if (geteuid() == 0 && chown(dir, uid, gid) != 0) { // Error. return 4; -- 2.49.0