Merge pull request #9055 from akretz/fix-ls-acl

ls: use file path for ACL check
This commit is contained in:
Sylvestre Ledru
2025-10-27 23:13:19 +01:00
committed by GitHub
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -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,
+9
View File
@@ -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