]> granicus.if.org Git - sudo/commitdiff
The fix for Bug #408 broke editing of files in an include dir that
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 31 Oct 2016 21:57:05 +0000 (15:57 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 31 Oct 2016 21:57:05 +0000 (15:57 -0600)
have a syntax error.  Normally, visudo does not edit those files,
but if a syntax error is detected in one, the user gets a chance
to fix it.

plugins/sudoers/visudo.c

index dec95da1f139e9266abddb65e454f8fd94f08923..9cec2856f05100fcbcc5232640858f4247de3eb7 100644 (file)
@@ -659,6 +659,9 @@ install_sudoers(struct sudoersfile *sp, bool oldperms)
     bool ret = false;
     debug_decl(install_sudoers, SUDOERS_DEBUG_UTIL)
 
+    if (sp->tpath == NULL)
+       goto done;
+
     if (!sp->modified) {
        /*
         * No changes but fix owner/mode if needed.