]> granicus.if.org Git - sudo/commitdiff
If invoked as sudoedit we can't just exec the command directly since
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 3 Jan 2014 23:41:25 +0000 (16:41 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 3 Jan 2014 23:41:25 +0000 (16:41 -0700)
the temporary files need to be updated before sudo exits.

src/exec.c

index d9cb76c8e7c66a69d5510d730575fe0b26c1b893..84cdb05d1039df528435765f634a1e831aedfdb1 100644 (file)
@@ -378,9 +378,12 @@ sudo_execute(struct command_details *details, struct command_status *cstat)
            utmp_user = details->utmp_user ? details->utmp_user : user_details.username;
        sudo_debug_printf(SUDO_DEBUG_INFO, "allocate pty for I/O logging");
        pty_setup(details->euid, user_details.tty, utmp_user);
-    } else if (!ISSET(details->flags, CD_SET_TIMEOUT) &&
+    } else if (!ISSET(details->flags, CD_SET_TIMEOUT|CD_SUDOEDIT) &&
        policy_plugin.u.policy->close == NULL) {
-       /* If no I/O logging, timeout or policy close we can exec directly. */
+       /*
+        * If there is no policy close function, no I/O logging or pty,
+        * and we were not invoked as sudoedit, just exec directly.
+        */
        exec_cmnd(details, cstat, -1);
        goto done;
     }