mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
mkdir: explicitly set umask when testing mode
This commit is contained in:
parent
9a6d47759b
commit
c561074425
1 changed files with 5 additions and 0 deletions
|
@ -162,9 +162,14 @@ fn test_symbolic_mode() {
|
||||||
fn test_symbolic_alteration() {
|
fn test_symbolic_alteration() {
|
||||||
let (at, mut ucmd) = at_and_ucmd!();
|
let (at, mut ucmd) = at_and_ucmd!();
|
||||||
|
|
||||||
|
let default_umask = 0o022;
|
||||||
|
let original_umask = unsafe { umask(default_umask) };
|
||||||
|
|
||||||
ucmd.arg("-m").arg("-w").arg(TEST_DIR1).succeeds();
|
ucmd.arg("-m").arg("-w").arg(TEST_DIR1).succeeds();
|
||||||
let perms = at.metadata(TEST_DIR1).permissions().mode();
|
let perms = at.metadata(TEST_DIR1).permissions().mode();
|
||||||
assert_eq!(perms, 0o40577);
|
assert_eq!(perms, 0o40577);
|
||||||
|
|
||||||
|
unsafe { umask(original_umask) };
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue