From: Stephen Seo Date: Wed, 25 Dec 2024 03:46:27 +0000 (+0900) Subject: Force set dir permissions when specified X-Git-Tag: 1.10^2~12 X-Git-Url: https://git.seodisparate.com/stephenseo/annotated.html?a=commitdiff_plain;h=3943d22e67d7944123b31cfed18c3bb64670efd2;p=SimpleArchiver 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. --- 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;