Merge branch 'setuid-again' into 'main'

arti: running_as_setuid: fix MacOs build

See merge request tpo/core/arti!697
This commit is contained in:
Nick Mathewson 2022-08-26 11:26:39 +00:00
commit 2e7028e8e2
1 changed files with 2 additions and 2 deletions

View File

@ -79,8 +79,8 @@ pub(crate) fn running_as_setuid() -> bool {
// We "sort of" ignore failures: in each case, we insist that both calls succeed,
// giving the same answer, or both calls fail. This ought to work well enough.
let same_reuid = libc::geteuid() == libc::getuid();
let same_regid = libc::getegid() == libc::getgid();
let same_reuid = unsafe { libc::geteuid() == libc::getuid() };
let same_regid = unsafe { libc::getegid() == libc::getgid() };
!(same_reuid && same_regid)
}
}