mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
cp: fail when trying to copy to read only file on mac (#5261)
* cp: fail when trying to copy to read only file * fix spelling error in macos.rs * simplify permissions check * add comment * fix typo
This commit is contained in:
parent
c5a0aa92f8
commit
252d01ac33
2 changed files with 25 additions and 2 deletions
|
@ -3440,3 +3440,19 @@ fn test_cp_only_source_no_target() {
|
|||
panic!("Failure: stderr was \n{stderr_str}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cp_dest_no_permissions() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = &ts.fixtures;
|
||||
|
||||
at.touch("valid.txt");
|
||||
at.touch("invalid_perms.txt");
|
||||
at.set_readonly("invalid_perms.txt");
|
||||
|
||||
ts.ucmd()
|
||||
.args(&["valid.txt", "invalid_perms.txt"])
|
||||
.fails()
|
||||
.stderr_contains("invalid_perms.txt")
|
||||
.stderr_contains("denied");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue