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

Also check sudoers gid if sudoers is group writable.

This commit is contained in:
Todd C. Miller
2011-08-13 18:34:37 -04:00
parent 6b9d80b106
commit d56a17165a

View File

@@ -964,7 +964,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 (ISSET(statbuf.st_mode, S_IRGRP) && 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)