From bb9775879bd11e6b1011ce51d15a44279e46de14 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 8 Jan 2014 17:02:22 -0700 Subject: [PATCH] Make noexec parameter to sudo_execve() bool. --- src/exec_common.c | 2 +- src/selinux.c | 2 +- src/sesh.c | 2 +- src/sudo_exec.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/exec_common.c b/src/exec_common.c index 83dfcd23b..1a54dd9c3 100644 --- a/src/exec_common.c +++ b/src/exec_common.c @@ -138,7 +138,7 @@ disable_execute(char *const envp[]) * ala execvp(3) if we get ENOEXEC. */ int -sudo_execve(const char *path, char *const argv[], char *const envp[], int noexec) +sudo_execve(const char *path, char *const argv[], char *const envp[], bool noexec) { /* Modify the environment as needed to disable further execve(). */ if (noexec) diff --git a/src/selinux.c b/src/selinux.c index f519ea14a..f81884a83 100644 --- a/src/selinux.c +++ b/src/selinux.c @@ -407,7 +407,7 @@ selinux_execve(const char *path, char *const argv[], char *const envp[], memcpy(&nargv[2], &argv[1], argc * sizeof(char *)); /* copies NULL */ /* sesh will handle noexec for us. */ - sudo_execve(sesh, nargv, envp, 0); + sudo_execve(sesh, nargv, envp, false); serrno = errno; free(nargv); errno = serrno; diff --git a/src/sesh.c b/src/sesh.c index b9cfd76c6..023f4d6db 100644 --- a/src/sesh.c +++ b/src/sesh.c @@ -46,7 +46,7 @@ int main(int argc, char *argv[], char *envp[]) { char *cp, *cmnd; - int noexec = 0; + bool noexec = false; debug_decl(main, SUDO_DEBUG_MAIN) setlocale(LC_ALL, ""); diff --git a/src/sudo_exec.h b/src/sudo_exec.h index 4fbb77acf..9be208e36 100644 --- a/src/sudo_exec.h +++ b/src/sudo_exec.h @@ -53,7 +53,7 @@ /* exec.c */ struct sudo_event_base; -int sudo_execve(const char *path, char *const argv[], char *const envp[], int noexec); +int sudo_execve(const char *path, char *const argv[], char *const envp[], bool noexec); extern volatile pid_t cmnd_pid; /* exec_pty.c */ -- 2.40.0