mkdir umask fix (#12354)

# Description
Fixes how the directory permissions are calculated in `mkdir`. Instead
of subtraction, the umask is actually used as a mask via negation
followed by bitwise and with the default mode. This matches how [uucore
calculates](cac7155fba/src/uu/mkdir/src/mkdir.rs (L61))
the mode.
This commit is contained in:
Ian Manske
2024-04-01 20:14:13 +00:00
committed by GitHub
parent 3bc0b332f4
commit aaefc5e110
2 changed files with 2 additions and 2 deletions

View File

@ -141,7 +141,7 @@ fn mkdir_umask_permission() {
assert_eq!(
actual, 0o40755,
"Most *nix systems have 0o00022 as the umask. \
So directory permission should be 0o40755 = 0o40777 - 0o00022"
So directory permission should be 0o40755 = 0o40777 & (!0o00022)"
);
})
}