diff --git a/src/uu/ls/src/colors.rs b/src/uu/ls/src/colors.rs
index 197fd2c8cec..3f8f56b3e55 100644
--- a/src/uu/ls/src/colors.rs
+++ b/src/uu/ls/src/colors.rs
@@ -530,7 +530,7 @@ pub(crate) fn color_name(
let has_capabilities = style_manager
.colors
.has_explicit_style_for(Indicator::Capabilities)
- && uucore::fsxattr::has_security_cap_acl(path.p_buf.as_path());
+ && path.has_security_cap();
// If the file has capabilities, use a specific style for `ca` (capabilities)
if has_capabilities {
diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs
index 507689eee41..05a25815aa4 100644
--- a/src/uu/ls/src/ls.rs
+++ b/src/uu/ls/src/ls.rs
@@ -9,12 +9,11 @@
#[cfg(unix)]
use rustc_hash::FxHashMap;
use rustc_hash::FxHashSet;
-use std::borrow::Cow;
-use std::cell::RefCell;
#[cfg(unix)]
use std::os::unix::fs::{FileTypeExt, MetadataExt};
#[cfg(windows)]
use std::os::windows::fs::MetadataExt;
+use std::{borrow::Cow, cell::RefCell};
use std::{
cell::{LazyCell, OnceCell},
cmp::Reverse,
@@ -42,7 +41,7 @@ use thiserror::Error;
#[cfg(unix)]
use uucore::entries;
#[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))]
-use uucore::fsxattr::has_acl;
+use uucore::fsxattr::retrieve_xattr_list;
#[cfg(unix)]
use uucore::libc::{S_IXGRP, S_IXOTH, S_IXUSR};
#[cfg(any(
@@ -63,14 +62,13 @@ use uucore::{
error::{UError, UResult, set_exit_code},
format::human::{SizeFormat, human_readable},
format_usage,
- fs::FileInformation,
- fs::display_permissions,
+ fs::{FileInformation, display_permissions},
fsext::{MetadataTimeField, metadata_get_time},
line_ending::LineEnding,
os_str_as_bytes_lossy,
- parser::parse_glob,
- parser::parse_size::parse_size_non_zero_u64,
- parser::shortcut_value_parser::ShortcutValueParser,
+ parser::{
+ parse_glob, parse_size::parse_size_non_zero_u64, shortcut_value_parser::ShortcutValueParser,
+ },
quoting_style::{QuotingStyle, locale_aware_escape_dir_name, locale_aware_escape_name},
show, show_error, show_warning,
time::{FormatSystemTimeFallback, format, format_system_time},
@@ -1932,6 +1930,8 @@ struct PathData {
// can be used to avoid reading the filetype. Can be also called d_type:
// https://www.gnu.org/software/libc/manual/html_node/Directory-Entries.html
de: RefCell