1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

ls -l: show an error when symlink not readable

switching to match and handle the error

Will help with tests/ls/stat-failed.sh
This commit is contained in:
Sylvestre Ledru 2023-09-15 22:34:17 +02:00
parent 97aa8ae5db
commit 37ee889003
2 changed files with 71 additions and 43 deletions

View file

@ -3503,3 +3503,22 @@ fn test_invalid_utf8() {
at.touch(filename);
ucmd.succeeds();
}
#[cfg(all(unix, feature = "chmod"))]
#[test]
fn test_ls_perm_io_errors() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.mkdir("d");
at.symlink_file("/", "d/s");
scene.ccmd("chmod").arg("600").arg("d").succeeds();
scene
.ucmd()
.arg("-l")
.arg("d")
.fails()
.code_is(1)
.stderr_contains("Permission denied");
}