mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Merge pull request #9055 from akretz/fix-ls-acl
ls: use file path for ACL check
This commit is contained in:
+1
-1
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user