if (!fork()) { /* child */
(void) close(1);
-#ifdef USE_EXECVE
- execve(mailer, exec_argv, environ);
-#else /* USE_EXECVE */
+#ifdef USE_EXECV
+ execv(mailer, exec_argv);
+#else /* USE_EXECV */
execvp(mailer, exec_argv);
-#endif /* USE_EXECVE */
+#endif /* USE_EXECV */
/* this should not happen */
-#ifdef USE_EXECVE
- perror("execve");
-#else /* USE_EXECVE */
+#ifdef USE_EXECV
+ perror("execv");
+#else /* USE_EXECV */
perror("execvp");
-#endif /* USE_EXECVE */
+#endif /* USE_EXECV */
exit(1);
} else { /* parent */
(void) close(0);
check_user();
log_error(ALL_SYSTEMS_GO);
be_root();
-#ifdef USE_EXECVE
- execve(cmnd, &Argv[1]);
-#else /* USE_EXECVE */
+#ifdef USE_EXECV
+ execv(cmnd, &Argv[1]);
+#else /* USE_EXECV */
execvp(cmnd, &Argv[1]);
-#endif /* USE_EXECVE */
+#endif /* USE_EXECV */
perror(cmnd); /* exec failed! */
exit(-1);
break;
*
* 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.
*/
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()
*/
* For OS's w/o mode_t
*/
#ifdef NO_MODE_T
-typedef int mode_t
+typedef int mode_t;
#endif
/*