Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
Browse files Browse the repository at this point in the history
ConnorNelson committed Dec 20, 2024

Verified

This commit was signed with the committer’s verified signature.
raimund-schluessler Raimund Schlüßler
1 parent 920df8c commit bc66a29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -44,11 +44,11 @@ fn main() {
let new_euid = if mode.contains(Mode::S_ISUID) { Uid::from_raw(stat.st_uid) } else { real_uid };
let new_egid = if mode.contains(Mode::S_ISGID) { Gid::from_raw(stat.st_gid) } else { real_gid };
let (new_ruid, new_rgid) = if matches.opt_present("real") { (new_euid, new_egid) } else { (real_uid, real_gid) };
if let Err(err) = unistd::setresgid(new_rgid, new_egid, Gid::from_raw(-1)) {
if let Err(err) = unistd::setresgid(new_rgid, new_egid, Gid::from_raw(u32::MAX)) {
eprintln!("{}: {}", path.display(), err);
process::exit(1);
}
if let Err(err) = unistd::setresuid(new_ruid, new_euid, Uid::from_raw(-1)) {
if let Err(err) = unistd::setresuid(new_ruid, new_euid, Uid::from_raw(u32::MAX)) {
eprintln!("{}: {}", path.display(), err);
process::exit(1);
}

0 comments on commit bc66a29

Please sign in to comment.