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: ancestors_mode_directories_with_file test fails with user with umask other than 022 #11363
After commit 0c41299 from PR #10140 , the test_install_ancestors_mode_directories_with_file test don't pass on my local environment.
Maybe related to the system I'm using, which is built from the LFS book, or related to the btrfs file system containing my local uutils repository.
EDIT:
This issue seems related with the default umask of my user, which is 002 by default.
The test assumes the directory created by install --mode=200 -D have the same permission with mkdir, but it's not true with the GNU install command.
changed the title [-]install: regression after the commit to prevent symlink race condition[/-][+]install: ancestors_mode_directories_with_file test fails with user with umask other than 022[/+]on Jun 8, 2026
You were right. GNU creates the parent directories for -d and -D at exactly 0755, independent of the umask — the manual states it for -d ("Parent directories are created with mode u=rwx,go=rx (755), regardless of the -m option or the current umask"), and I verified it against GNU 9.12, the version pinned in util/fetch-gnu.sh, at umasks 022, 027, 077, 002 and 111.
We were passing 0755 to mkdir(2), so the kernel still subtracted the umask: ancestors came out 0700 under 077 and 0750 under 027. The test hid that because it compared the ancestors against a probe directory created with mkdir(2) at 0777, which also lands on 0755 under the usual 022 but on 0775 under your 002. Running as root passes for the same accidental reason, not because the mode was right.
#12715 clears the umask around the ancestor creation and drops the probe. The tests now run under umask 077 and assert 0755 on the ancestors, with --mode applying only to the target, so this stays fixed for people whose umask isn't 022.
Anyway, the test must be fixed to use a fixed value: 755, no matter what umask is.
Compare the default permission with a directory made by mkdir is obviously not a good idea. because mkdir is affected by umask whereas -D should be against that.
Activity
[-]install: regression after[/-][+]install: regression after the commit to prevent symlink race condition[/+]zhw2101024 commentedon Mar 18, 2026
I can confirm that the test passes when running with the root user, but fails when running with a regular user.
fix(install): fix the ancestors_mode_directories_with_file test (uuti…
zhw2101024 commentedon May 26, 2026
While the PR #11505 has been merged, the test still fails when running with user other than root.
[-]install: regression after the commit to prevent symlink race condition[/-][+]install: ancestors_mode_directories_with_file test fails with user with umask other than 022[/+]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 Sep 21, 2026
Sorry for the long silence here.
You were right. GNU creates the parent directories for
-dand-Dat exactly 0755, independent of the umask — the manual states it for-d("Parent directories are created with modeu=rwx,go=rx(755), regardless of the-moption or the current umask"), and I verified it against GNU 9.12, the version pinned inutil/fetch-gnu.sh, at umasks 022, 027, 077, 002 and 111.We were passing 0755 to
mkdir(2), so the kernel still subtracted the umask: ancestors came out 0700 under 077 and 0750 under 027. The test hid that because it compared the ancestors against a probe directory created withmkdir(2)at 0777, which also lands on 0755 under the usual 022 but on 0775 under your 002. Running as root passes for the same accidental reason, not because the mode was right.#12715 clears the umask around the ancestor creation and drops the probe. The tests now run under umask 077 and assert 0755 on the ancestors, with
--modeapplying only to the target, so this stays fixed for people whose umask isn't 022.lsahn-gh commentedon Oct 24, 2026
Anyway, the test must be fixed to use a fixed value: 755, no matter what umask is.
Compare the default permission with a directory made by
mkdiris obviously not a good idea. becausemkdiris affected by umask whereas-Dshould be against that.PR for that, #15710.