Skip to content

Commit

Permalink
cp: remove check for ownership perm for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhs0506 committed May 10, 2023
1 parent a710805 commit 2f4afc5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/uu/cp/src/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1759,9 +1759,19 @@ fn copy_helper(
Ok(())
}

#[cfg(not(windows))]
fn should_preserve_attribute(options: &Options) -> bool {
matches!(options.attributes.mode, Preserve::Yes { .. })
|| matches!(options.attributes.timestamps, Preserve::Yes { .. })
|| matches!(options.attributes.links, Preserve::Yes { .. })
|| matches!(options.attributes.context, Preserve::Yes { .. })
|| matches!(options.attributes.xattr, Preserve::Yes { .. })
|| matches!(options.attributes.ownership, Preserve::Yes { .. })
}

#[cfg(windows)]
fn should_preserve_attribute(options: &Options) -> bool {
matches!(options.attributes.mode, Preserve::Yes { .. })
|| matches!(options.attributes.timestamps, Preserve::Yes { .. })
|| matches!(options.attributes.links, Preserve::Yes { .. })
|| matches!(options.attributes.context, Preserve::Yes { .. })
Expand Down

0 comments on commit 2f4afc5

Please sign in to comment.