]> granicus.if.org Git - sudo/commitdiff
Update statbuf.st_mode based on SUDOERS_MODE when we are chaning from
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 3 Jan 2000 04:53:35 +0000 (04:53 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 3 Jan 2000 04:53:35 +0000 (04:53 +0000)
0400 to whatever SUDOERS_MODE is (converting from the old sudoers mode).
Assumes that SUDOERS_MODE is less restrictive than 0400 which should
always be the case.

sudo.c

diff --git a/sudo.c b/sudo.c
index 43167224f7aca562fcbdaf523a5c31ef5c872c69..ccace3db3c24cd88098e65ac2c6a1112543c3ed5 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -766,6 +766,7 @@ check_sudoers()
        if (chmod(_PATH_SUDOERS, SUDOERS_MODE) == 0) {
            (void) fprintf(stderr, "%s: fixed mode on %s\n",
                Argv[0], _PATH_SUDOERS);
+           statbuf.st_mode |= SUDOERS_MODE;
            if (statbuf.st_gid != SUDOERS_GID) {
                if (!chown(_PATH_SUDOERS,(uid_t) -1,SUDOERS_GID)) {
                    (void) fprintf(stderr, "%s: set group on %s\n",