mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
id: The --real flag should only affect -u, -g, and -G (#7796)
* id: The `--real` flag should only affect `-u`, `-g`, and `-U` * id: Test output with different UID and EUID * id: Simplify testing different UID and EUID * id: Compile preload file for test using cc instead of gcc * id: Remove test for different UID and EUID The test is incompatible with some CI/CD targets. This reverts the following commits: -8efcbf9ada-208fa8e7f8-a498a2722d
This commit is contained in:
+8
-4
@@ -238,10 +238,14 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
let (uid, gid) = possible_pw.as_ref().map(|p| (p.uid, p.gid)).unwrap_or((
|
let (uid, gid) = possible_pw.as_ref().map(|p| (p.uid, p.gid)).unwrap_or({
|
||||||
if state.rflag { getuid() } else { geteuid() },
|
let use_effective = !state.rflag && (state.uflag || state.gflag || state.gsflag);
|
||||||
if state.rflag { getgid() } else { getegid() },
|
if use_effective {
|
||||||
));
|
(geteuid(), getegid())
|
||||||
|
} else {
|
||||||
|
(getuid(), getgid())
|
||||||
|
}
|
||||||
|
});
|
||||||
state.ids = Some(Ids {
|
state.ids = Some(Ids {
|
||||||
uid,
|
uid,
|
||||||
gid,
|
gid,
|
||||||
|
|||||||
Reference in New Issue
Block a user