#if defined(RLIMIT_CORE) && !defined(SUDO_DEVEL)
static struct rlimit corelimit;
#endif /* RLIMIT_CORE && !SUDO_DEVEL */
-sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp;
int
main(int argc, char *argv[], char *envp[])
{
- sigaction_t sa;
int nargc, sudo_mode;
char **nargv, **settings, **env_add;
char **user_info, **command_info, **argv_out, **user_env_out;
if (geteuid() != 0)
errorx(1, "must be setuid root");
- /*
- * Signal setup:
- * Ignore keyboard-generated signals so the user cannot interrupt
- * us at some point and avoid the logging.
- * XXX - leave this to the plugin?
- */
- zero_bytes(&sa, sizeof(sa));
- sigemptyset(&sa.sa_mask);
- sa.sa_flags = SA_RESTART;
- sa.sa_handler = SIG_IGN;
- (void) sigaction(SIGINT, &sa, &saved_sa_int);
- (void) sigaction(SIGQUIT, &sa, &saved_sa_quit);
- (void) sigaction(SIGTSTP, &sa, &saved_sa_tstp);
-
/* Turn off core dumps and make sure fds 0-2 are open. */
disable_coredumps();
fix_fds();
#include "sudo.h"
-extern sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp;
extern char **environ;
static char *find_editor();
nargv[ac++] = tf[i++].tfile;
nargv[ac] = NULL;
- /* Allow the editor to be suspended. */
- (void) sigaction(SIGTSTP, &saved_sa_tstp, NULL);
-
/*
* Fork and exec the editor with the invoking user's creds,
* keeping track of the time spent in the editor.
goto cleanup;
} else if (kidpid == 0) {
/* child */
- (void) sigaction(SIGINT, &saved_sa_int, NULL);
- (void) sigaction(SIGQUIT, &saved_sa_quit, NULL);
set_perms(PERM_FULL_USER);
closefrom(def_closefrom);
execvp(nargv[0], nargv);