]> granicus.if.org Git - sudo/commitdiff
Only set the session id if we are running a command or editing a file.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 3 Sep 2009 23:26:05 +0000 (23:26 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 3 Sep 2009 23:26:05 +0000 (23:26 +0000)
sudo.c

diff --git a/sudo.c b/sudo.c
index 3cc7cc44b21a97fe8d16b6c7983550ed55001a9d..c54d4ee6f5d89a0c503327bd09fec2ed190bc988 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -461,8 +461,8 @@ main(argc, argv, envp)
        }
 
        /* Get next session ID so we can log it. */
-       if (def_script)
-           script_nextid(); /* XXX - only if we will run a command */
+       if (def_script && ISSET(sudo_mode, (MODE_RUN | MODE_EDIT)))
+           script_nextid();
 
        log_allowed(validated);
        if (ISSET(sudo_mode, MODE_CHECK))