2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

setreuid(0, 0) fails on QNX if the euid is not already 0 so set the

euid first, then just call setuid(0) to set the real uid too.
This commit is contained in:
Todd C. Miller
2004-02-06 23:08:04 +00:00
parent 7bc6df0246
commit a622cb2795

View File

@@ -256,8 +256,10 @@ set_perms_suid(perm)
switch (perm) {
case PERM_FULL_ROOT:
case PERM_ROOT:
if (setreuid(0, 0))
fatal("setreuid(0, 0) failed, your operating system may have a broken setreuid() function\nTry running configure with --disable-setreuid", 0);
if (setreuid(-1, 0))
fatal("setreuid(-1, 0) failed, your operating system may have a broken setreuid() function\nTry running configure with --disable-setreuid", 0);
if (setuid(0))
fatal("setuid(0)", 1);
break;
case PERM_USER: