Component
cp
Description
uutils cp -p preserves extended attributes, but GNU cp -p does not. GNU only preserves mode, ownership, and timestamps with -p; xattrs require explicit --preserve=xattr or -a.
Test / Reproduction Steps
Not necessary.
pub const DEFAULT: Self = Self {
#[cfg(unix)]
ownership: Preserve::Yes { required: true },
mode: Preserve::Yes { required: true },
timestamps: Preserve::Yes { required: true },
xattr: Preserve::Yes { required: true }, // <----
Impact
This breaks compatibility with scripts expecting GNU behavior and creates a security risk when run as root.
File capabilities and SELinux labels stored as xattrs get copied unintentionally. It also causes hard failures on filesystems that don't support xattrs, while GNU cp -p would succeed.
Component
cpDescription
uutils
cp -ppreserves extended attributes, but GNUcp -pdoes not. GNU only preserves mode, ownership, and timestamps with-p; xattrs require explicit--preserve=xattror-a.Test / Reproduction Steps
Not necessary.
Impact
This breaks compatibility with scripts expecting GNU behavior and creates a security risk when run as root.
File capabilities and SELinux labels stored as xattrs get copied unintentionally. It also causes hard failures on filesystems that don't support xattrs, while GNU
cp -pwould succeed.