diff --git a/Cargo.lock b/Cargo.lock index 3db6e43736..2e0ac982df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1018,18 +1018,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "exacl" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de9e551ced9d700a31dacb8b168129640240fcd7a279a3fa4d59608b84ebcae" -dependencies = [ - "bitflags 2.11.1", - "log", - "scopeguard", - "uuid", -] - [[package]] name = "fastrand" version = "2.4.1" @@ -3430,7 +3418,6 @@ version = "0.9.0" dependencies = [ "clap", "codspeed-divan-compat", - "exacl", "filetime", "fluent", "indicatif", @@ -3443,6 +3430,7 @@ dependencies = [ "uucore", "walkdir", "windows-sys 0.61.2", + "xattr", ] [[package]] @@ -4615,16 +4603,6 @@ dependencies = [ "quote", ] -[[package]] -name = "uuid" -version = "1.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "uutests" version = "0.9.0" diff --git a/Cargo.toml b/Cargo.toml index 53f6e7a90e..072aaa38ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,11 +74,6 @@ feat_systemd_logind = [ "uucore/feat_systemd_logind", "who/feat_systemd_logind", ] -# "feat_acl" == enable support for ACLs (access control lists; by using`--features feat_acl`) -# NOTE: -# * On linux, the posix-acl/acl-sys crate requires `libacl` headers and shared library to be accessible in the C toolchain at compile time. -# * On FreeBSD and macOS this is not required. -feat_acl = ["cp/feat_acl"] # "feat_selinux" == enable support for SELinux Security Context (by using `--features feat_selinux`) # NOTE: # * The selinux(-sys) crate requires `libselinux` headers and shared library to be accessible in the C toolchain at compile time. diff --git a/src/uu/cp/Cargo.toml b/src/uu/cp/Cargo.toml index cf412e89be..e7f5c89b72 100644 --- a/src/uu/cp/Cargo.toml +++ b/src/uu/cp/Cargo.toml @@ -44,8 +44,8 @@ rustix = { workspace = true } selinux = { workspace = true, optional = true } [target.'cfg(unix)'.dependencies] -exacl = { workspace = true, optional = true } nix = { workspace = true, features = ["fs"] } +xattr = { workspace = true } [target.'cfg(target_os = "windows")'.dependencies] windows-sys = { workspace = true, features = [ @@ -68,4 +68,3 @@ harness = false [features] feat_selinux = ["selinux", "uucore/selinux"] -feat_acl = ["exacl"] diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index 75f79816a5..8e3538b4ca 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -1884,18 +1884,13 @@ pub(crate) fn copy_attributes( fs::set_permissions(dest, source_perms) .map_err(|e| CpError::IoErrContext(e, context.to_owned()))?; - // FIXME: Implement this for windows as well - #[cfg(feature = "feat_acl")] - exacl::getfacl(source, None) - .and_then(|acl| exacl::setfacl(&[dest], &acl, None)) - .map_err(|err| CpError::Error(err.to_string()))?; // GNU `cp -p` preserves POSIX ACLs as part of mode. On Linux the // ACLs are stored as `system.posix_acl_*` xattrs; copy just those // so we keep ACL parity with GNU without preserving user xattrs // (which are intentionally excluded from the default -p set per // issue #9704). Best-effort: ignore failures on filesystems that // do not support ACL xattrs. - #[cfg(all(unix, not(target_os = "android")))] + #[cfg(all(unix, not(target_os = "android")))] // todo: support acl for other targets copy_acls(source, dest); }