mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2026-01-16 18:21:01 +00:00
cp: --preserve should keep xattr (#5834)
* cp: --preserve should keep xattr Should help with tests/cp/acl.sh * Update tests/by-util/test_cp.rs Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com> * Update tests/by-util/test_cp.rs Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com> * Update tests/by-util/test_cp.rs Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com> --------- Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
parent
e340d8177e
commit
fff83995fb
4 changed files with 62 additions and 3 deletions
|
|
@ -826,6 +826,7 @@ impl Attributes {
|
|||
ownership: Preserve::Yes { required: true },
|
||||
mode: Preserve::Yes { required: true },
|
||||
timestamps: Preserve::Yes { required: true },
|
||||
xattr: Preserve::Yes { required: true },
|
||||
..Self::NONE
|
||||
};
|
||||
|
||||
|
|
@ -1441,7 +1442,7 @@ pub(crate) fn copy_attributes(
|
|||
})?;
|
||||
|
||||
handle_preserve(&attributes.xattr, || -> CopyResult<()> {
|
||||
#[cfg(unix)]
|
||||
#[cfg(all(unix, not(target_os = "android")))]
|
||||
{
|
||||
let xattrs = xattr::list(source)?;
|
||||
for attr in xattrs {
|
||||
|
|
@ -1450,7 +1451,7 @@ pub(crate) fn copy_attributes(
|
|||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(unix))]
|
||||
#[cfg(not(all(unix, not(target_os = "android"))))]
|
||||
{
|
||||
// The documentation for GNU cp states:
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue