execve -> execv

This commit is contained in:
Todd C. Miller
1994-02-28 05:27:51 +00:00
parent beaf4c0f3b
commit eea6d47b7f
3 changed files with 15 additions and 15 deletions

View File

@@ -392,18 +392,18 @@ static void send_mail()
if (!fork()) { /* child */ if (!fork()) { /* child */
(void) close(1); (void) close(1);
#ifdef USE_EXECVE #ifdef USE_EXECV
execve(mailer, exec_argv, environ); execv(mailer, exec_argv);
#else /* USE_EXECVE */ #else /* USE_EXECV */
execvp(mailer, exec_argv); execvp(mailer, exec_argv);
#endif /* USE_EXECVE */ #endif /* USE_EXECV */
/* this should not happen */ /* this should not happen */
#ifdef USE_EXECVE #ifdef USE_EXECV
perror("execve"); perror("execv");
#else /* USE_EXECVE */ #else /* USE_EXECV */
perror("execvp"); perror("execvp");
#endif /* USE_EXECVE */ #endif /* USE_EXECV */
exit(1); exit(1);
} else { /* parent */ } else { /* parent */
(void) close(0); (void) close(0);

10
sudo.c
View File

@@ -144,11 +144,11 @@ main(argc, argv)
check_user(); check_user();
log_error(ALL_SYSTEMS_GO); log_error(ALL_SYSTEMS_GO);
be_root(); be_root();
#ifdef USE_EXECVE #ifdef USE_EXECV
execve(cmnd, &Argv[1]); execv(cmnd, &Argv[1]);
#else /* USE_EXECVE */ #else /* USE_EXECV */
execvp(cmnd, &Argv[1]); execvp(cmnd, &Argv[1]);
#endif /* USE_EXECVE */ #endif /* USE_EXECV */
perror(cmnd); /* exec failed! */ perror(cmnd); /* exec failed! */
exit(-1); exit(-1);
break; break;
@@ -276,7 +276,7 @@ static void usage()
* *
* clean_env() * clean_env()
* *
* This function builds cleans up the environ pointer so that all execvp()'s * This function builds cleans up the environ pointer so that all execv*()'s
* omit LD_* variables and hard-code PATH if SECURE_PATH is defined. * omit LD_* variables and hard-code PATH if SECURE_PATH is defined.
*/ */

4
sudo.h
View File

@@ -110,7 +110,7 @@
STD_HEADERS if you have ansi-compliant header files STD_HEADERS if you have ansi-compliant header files
USE_EXECVE if you want to use execve() instead of USE_EXECV if you want to use execv() instead of
execvp() execvp()
*/ */
@@ -337,7 +337,7 @@ extern char ** environ;
* For OS's w/o mode_t * For OS's w/o mode_t
*/ */
#ifdef NO_MODE_T #ifdef NO_MODE_T
typedef int mode_t typedef int mode_t;
#endif #endif
/* /*