Can now deal with SUDOERS_UID == 0 and SUDOERS_MODE == 0400
This commit is contained in:
11
sudo.c
11
sudo.c
@@ -939,13 +939,14 @@ void set_perms(perm, sudo_mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If SUDOERS_UID == 0 we need to use
|
* If SUDOERS_UID == 0 and SUDOERS_MODE
|
||||||
* a different uid in order to avoid
|
* is group readable we use a non-zero
|
||||||
* NFS lossage. Using uid 1 is a bit
|
* uid in order to avoid NFS lossage.
|
||||||
* bogus but should be safe.
|
* Using uid 1 is a bit bogus but should
|
||||||
|
* work on all OS's.
|
||||||
*/
|
*/
|
||||||
if (SUDOERS_UID == 0) {
|
if (SUDOERS_UID == 0) {
|
||||||
if (seteuid(1)) {
|
if ((SUDOERS_MODE & 040) && seteuid(1)) {
|
||||||
perror("seteuid(1)");
|
perror("seteuid(1)");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user