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

ls: force fetching metadata when called with -L -Z

The metadata are not used but it permits to check the symlink is valid.
We then return 1 on invalid symlinks when ls is invoked with ls -L -Z

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
This commit is contained in:
Guillaume Ranquet 2023-06-08 11:26:21 +02:00
parent ba7c53ae5a
commit 80c7ed9732
2 changed files with 24 additions and 0 deletions

View file

@ -3137,6 +3137,16 @@ fn test_ls_dangling_symlinks() {
.stderr_contains("No such file or directory")
.stdout_contains(if cfg!(windows) { "dangle" } else { "? dangle" });
scene
.ucmd()
.arg("-LZ")
.arg("temp_dir")
.fails()
.code_is(1)
.stderr_contains("cannot access")
.stderr_contains("No such file or directory")
.stdout_contains(if cfg!(windows) { "dangle" } else { "? dangle" });
scene
.ucmd()
.arg("-Ll")