diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index 064e1b1e5..6f038142a 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -2827,7 +2827,7 @@ fn display_item_long( // TODO: See how Mac should work here let is_acl_set = false; #[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))] - let is_acl_set = has_acl(item.display_name()); + let is_acl_set = has_acl(item.path()); output_display.extend(display_permissions(md, true).as_bytes()); if item.security_context(config).len() > 1 { // GNU `ls` uses a "." character to indicate a file with a security context, diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index a8ce2c32c..ef7591b8a 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -5762,6 +5762,15 @@ fn test_acl_display() { .succeeds() .stdout_matches(&re_with_acl) .stdout_matches(&re_without_acl); + + // Verify that it also works if the current dir is different from the ucmd temporary dir + scene + .ucmd() + .current_dir("/") + .args(&["-la", &at.as_string()]) + .succeeds() + .stdout_matches(&re_with_acl) + .stdout_matches(&re_without_acl); } // Make sure that "ls --color" correctly applies color "normal" to text and