Move sudo_debug_execve() call into sudo_execve().

This commit is contained in:
Todd C. Miller
2016-06-09 10:48:59 -06:00
parent 12ab5b8108
commit 1ec4d9918d
2 changed files with 5 additions and 3 deletions

View File

@@ -157,8 +157,6 @@ exec_cmnd(struct command_details *details, struct command_status *cstat,
restore_signals(); restore_signals();
if (exec_setup(details, NULL, -1) == true) { if (exec_setup(details, NULL, -1) == true) {
/* headed for execve() */ /* headed for execve() */
sudo_debug_execve(SUDO_DEBUG_INFO, details->command,
details->argv, details->envp);
if (details->closefrom >= 0) { if (details->closefrom >= 0) {
int fd, maxfd; int fd, maxfd;
unsigned char *debug_fds; unsigned char *debug_fds;

View File

@@ -181,6 +181,10 @@ disable_execute(char *envp[])
int int
sudo_execve(int fd, const char *path, char *const argv[], char *envp[], bool noexec) sudo_execve(int fd, const char *path, char *const argv[], char *envp[], bool noexec)
{ {
debug_decl(sudo_execve, SUDO_DEBUG_UTIL)
sudo_debug_execve(SUDO_DEBUG_INFO, path, argv, envp);
/* Modify the environment as needed to disable further execve(). */ /* Modify the environment as needed to disable further execve(). */
if (noexec) if (noexec)
envp = disable_execute(envp); envp = disable_execute(envp);
@@ -206,5 +210,5 @@ sudo_execve(int fd, const char *path, char *const argv[], char *envp[], bool noe
free(nargv); free(nargv);
} }
} }
return -1; debug_return_int(-1);
} }