mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
uu_install: check for permission change on -C option
This commit is contained in:
parent
5262c043f3
commit
b22d2470ac
1 changed files with 5 additions and 0 deletions
|
@ -757,6 +757,8 @@ fn need_copy(from: &Path, to: &Path, b: &Behavior) -> UResult<bool> {
|
||||||
|
|
||||||
// setuid || setgid || sticky
|
// setuid || setgid || sticky
|
||||||
let extra_mode: u32 = 0o7000;
|
let extra_mode: u32 = 0o7000;
|
||||||
|
// setuid || setgid || sticky || permissions
|
||||||
|
let all_modes: u32 = 0o7777;
|
||||||
|
|
||||||
if b.specified_mode.unwrap_or(0) & extra_mode != 0
|
if b.specified_mode.unwrap_or(0) & extra_mode != 0
|
||||||
|| from_meta.mode() & 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);
|
return Ok(true);
|
||||||
}
|
}
|
||||||
|
if b.mode() != to_meta.mode() & all_modes {
|
||||||
|
return Ok(true);
|
||||||
|
}
|
||||||
|
|
||||||
if !from_meta.is_file() || !to_meta.is_file() {
|
if !from_meta.is_file() || !to_meta.is_file() {
|
||||||
return Ok(true);
|
return Ok(true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue