From b317dc70ac3032b04b6465f318af7e79bba12e48 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 11 Nov 1996 01:32:33 +0000 Subject: [PATCH] Can now deal with SUDOERS_UID == 0 and SUDOERS_MODE == 0400 --- sudo.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sudo.c b/sudo.c index 325510ff8..52245b071 100644 --- a/sudo.c +++ b/sudo.c @@ -939,13 +939,14 @@ void set_perms(perm, sudo_mode) } /* - * If SUDOERS_UID == 0 we need to use - * a different uid in order to avoid - * NFS lossage. Using uid 1 is a bit - * bogus but should be safe. + * If SUDOERS_UID == 0 and SUDOERS_MODE + * is group readable we use a non-zero + * uid in order to avoid NFS lossage. + * Using uid 1 is a bit bogus but should + * work on all OS's. */ if (SUDOERS_UID == 0) { - if (seteuid(1)) { + if ((SUDOERS_MODE & 040) && seteuid(1)) { perror("seteuid(1)"); exit(1); } -- 2.50.1