mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
uu_install: check for permission change on -C option
This commit is contained in:
@@ -757,6 +757,8 @@ fn need_copy(from: &Path, to: &Path, b: &Behavior) -> UResult<bool> {
|
||||
|
||||
// setuid || setgid || sticky
|
||||
let extra_mode: u32 = 0o7000;
|
||||
// setuid || setgid || sticky || permissions
|
||||
let all_modes: u32 = 0o7777;
|
||||
|
||||
if b.specified_mode.unwrap_or(0) & extra_mode != 0
|
||||
|| from_meta.mode() & extra_mode != 0
|
||||
@@ -764,6 +766,9 @@ fn need_copy(from: &Path, to: &Path, b: &Behavior) -> UResult<bool> {
|
||||
{
|
||||
return Ok(true);
|
||||
}
|
||||
if b.mode() != to_meta.mode() & all_modes {
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
if !from_meta.is_file() || !to_meta.is_file() {
|
||||
return Ok(true);
|
||||
|
||||
Reference in New Issue
Block a user