From a430cdd9dce379247419e6fb07f6d264901d15f4 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 13 Aug 2011 18:35:17 -0400 Subject: [PATCH] Only check gid of sudoers file if it is group-readable or writable. --HG-- branch : 1.7 --- sudo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sudo.c b/sudo.c index 78aa82fbd..fbcd99e2e 100644 --- a/sudo.c +++ b/sudo.c @@ -1033,7 +1033,7 @@ open_sudoers(sudoers, doedit, keepopen) else if (statbuf.st_uid != SUDOERS_UID) log_error(NO_EXIT, "%s is owned by uid %u, should be %u", sudoers, (unsigned int) statbuf.st_uid, (unsigned int) SUDOERS_UID); - else if (statbuf.st_gid != SUDOERS_GID) + else if (statbuf.st_gid != SUDOERS_GID && ISSET(statbuf.st_mode, S_IRGRP|S_IWGRP)) log_error(NO_EXIT, "%s is owned by gid %u, should be %u", sudoers, (unsigned int) statbuf.st_gid, (unsigned int) SUDOERS_GID); else if ((fp = fopen(sudoers, "r")) == NULL) -- 2.50.1