]> granicus.if.org Git - sudo/commitdiff
Don't try to install the temporary sudoers file if we didn't edit it.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 9 May 2014 15:29:42 +0000 (09:29 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 9 May 2014 15:29:42 +0000 (09:29 -0600)
By default, visudo does not edit files in a #includedir.
Fixes a NULL pointer defef on GNU hurd; Bug #647

plugins/sudoers/visudo.c

index c491629f2097fbb7b720f68c350008f5f3c62de5..79e6486bfe61c5bc66fbc2d1dc81e5c2d28e1660 100644 (file)
@@ -266,7 +266,8 @@ main(int argc, char *argv[])
      */
     if (reparse_sudoers(editor, args, strict, quiet)) {
        TAILQ_FOREACH(sp, &sudoerslist, entries) {
-           (void) install_sudoers(sp, oldperms);
+           if (sp->doedit)
+               (void) install_sudoers(sp, oldperms);
        }
     }