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:
commit
2e7028e8e2
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue