You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
install: ancestor directories respect process umask instead of using fixed 0755 (diverges from GNU) #12714
When install -D or install -d creates ancestor directories, the process umask still applies to them. GNU install creates ancestor directories at exactly 0755 whatever the caller's umask is.
Impact
Ancestor modes when creating a/b as a non-root user on Linux (uutils main at 2b85f6f, GNU 9.12 built from source):
umask
GNU -D and -d
uutils install -D f a/b/f
uutils install -d a/b (ancestor a)
0022
0755
0755
0755
0002
0755
0755
0775
0027
0755
0750
0750
0077
0755
0700
0700
0111
0755
a is 0644, then cannot create directory 'a/b'
a is 0666, then cannot create directory 'a/b': Permission denied
-D starts its ancestors from 0755 and -d from 0777, and the umask is then applied to both. Under umask 0002 (the trigger for #11363) -D happens to give 0755, so that report came from a broken test, but -d diverges there too.
Affected code
src/uu/install/src/install.rs: both code paths (directory() line ~498 and standard() line ~687) create ancestor directories without zeroing umask first
src/uucore/src/lib/features/safe_traversal.rs: create_dir_all_safe documents that "the actual mode will be modified by the process umask"
Fix
Zero the process umask early in install's uumain (unix only). uucore::mode already uses rustix::process::umask internally for get_umask(); a zero_umask() helper can be exported from there.
Rechecked against GNU 9.12 built from the release tarball: GNU gives 0755 at every umask in the table. The uutils column was off for -d, which starts from 0777 so 0002 diverges too, and for 0111, where both modes fail outright. I've split the table and replaced the section describing GNU's internals with the observed behavior.
Activity
fix(install): zero umask at startup so ancestor dirs are created at e…
fix(install): zero umask at startup so ancestor dirs are created at e…
abendrothj commentedon Oct 1, 2026
Rechecked against GNU 9.12 built from the release tarball: GNU gives
0755at every umask in the table. The uutils column was off for-d, which starts from0777so0002diverges too, and for0111, where both modes fail outright. I've split the table and replaced the section describing GNU's internals with the observed behavior.