Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5b8c28

Browse files
authored
Merge pull request #9055 from akretz/fix-ls-acl
ls: use file path for ACL check
2 parents 76c4278 + a58b1be commit b5b8c28

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/uu/ls/src/ls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2827,7 +2827,7 @@ fn display_item_long(
28272827
// TODO: See how Mac should work here
28282828
let is_acl_set = false;
28292829
#[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))]
2830-
let is_acl_set = has_acl(item.display_name());
2830+
let is_acl_set = has_acl(item.path());
28312831
output_display.extend(display_permissions(md, true).as_bytes());
28322832
if item.security_context(config).len() > 1 {
28332833
// GNU `ls` uses a "." character to indicate a file with a security context,

tests/by-util/test_ls.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5762,6 +5762,15 @@ fn test_acl_display() {
57625762
.succeeds()
57635763
.stdout_matches(&re_with_acl)
57645764
.stdout_matches(&re_without_acl);
5765+
5766+
// Verify that it also works if the current dir is different from the ucmd temporary dir
5767+
scene
5768+
.ucmd()
5769+
.current_dir("/")
5770+
.args(&["-la", &at.as_string()])
5771+
.succeeds()
5772+
.stdout_matches(&re_with_acl)
5773+
.stdout_matches(&re_without_acl);
57655774
}
57665775

57675776
// Make sure that "ls --color" correctly applies color "normal" to text and

0 commit comments

Comments
 (0)