Fix last commit, now that argc is not reset we need to explicitly

start the copy from argv[1].  From Daniel Kopecek
This commit is contained in:
Todd C. Miller
2016-05-13 06:40:59 -06:00
parent ea5bd18b92
commit a2085809fa

View File

@@ -425,7 +425,7 @@ selinux_execve(int fd, const char *path, char *const argv[], char *envp[],
debug_return;
}
nargv[nargc++] = (char *)path;
memcpy(&nargv[nargc], &argv[argc], argc * sizeof(char *)); /* copies NULL */
memcpy(&nargv[nargc], &argv[1], argc * sizeof(char *)); /* copies NULL */
/* sesh will handle noexec for us. */
sudo_execve(-1, sesh, nargv, envp, false);