From 45ff42eb9f4efd5e16a089588dbfa5cb2f50d2e0 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 9 May 2014 09:29:42 -0600 Subject: [PATCH] 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 --- plugins/sudoers/visudo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/visudo.c b/plugins/sudoers/visudo.c index c491629f2..79e6486bf 100644 --- a/plugins/sudoers/visudo.c +++ b/plugins/sudoers/visudo.c @@ -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); } }