]> granicus.if.org Git - sudo/commitdiff
Only check gid of sudoers file if it is group-readable.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 16 May 2011 16:19:07 +0000 (12:19 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 16 May 2011 16:19:07 +0000 (12:19 -0400)
plugins/sudoers/sudoers.c

index f533e591bd6b0483e79942197fd4cb1fc105392a..b0a3b86e8577042d977b2ce1bfbbaec9045b720d 100644 (file)
@@ -930,7 +930,7 @@ open_sudoers(const char *sudoers, int doedit, int *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 (ISSET(statbuf.st_mode, S_IRGRP) && statbuf.st_gid != sudoers_gid)
        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)