From 6290ce41f3ec1f889abb881cf90ca91da869b5b2 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 30 Jul 2024 16:44:17 -0400 Subject: parse: Take umask into account in parse_mode() POSIX 2024 clarified that find(1) is meant to work exactly like chmod(1) here, so for modes like +rw,-x with no "who" specified, apply the umask. Link: https://www.austingroupbugs.net/view.php?id=1392 --- src/ctx.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ctx.h') diff --git a/src/ctx.h b/src/ctx.h index b28a63c..064e8b0 100644 --- a/src/ctx.h +++ b/src/ctx.h @@ -16,6 +16,7 @@ #include "trie.h" #include #include +#include #include struct CFILE; @@ -98,6 +99,9 @@ struct bfs_ctx { /** The number of files owned by the context. */ int nfiles; + /** The current file creation mask. */ + mode_t umask; + /** The initial RLIMIT_NOFILE limits. */ struct rlimit orig_nofile; /** The current RLIMIT_NOFILE limits. */ -- cgit v1.2.3