Don't try to install the temporary sudoers file if we didn't edit it.

By default, visudo does not edit files in a #includedir.
Fixes a NULL pointer defef on GNU hurd; Bug #647
This commit is contained in:
Todd C. Miller
2014-05-09 09:29:42 -06:00
parent 9cdf7797cf
commit 45ff42eb9f

View File

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