]> granicus.if.org Git - sudo/commitdiff
Main sudo should not block signals; the plugin should do this in
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 1 Apr 2010 10:35:19 +0000 (06:35 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 1 Apr 2010 10:35:19 +0000 (06:35 -0400)
check_policy.

plugins/sudoers/sudoers.c
src/sudo.c
src/sudo_edit.c

index 1e8f18219a2f231b72b6ecb141ed26e6b3b2b929..8e8c49d697fe0024a0ced3a7f7ef2683ef6cd128 100644 (file)
@@ -194,7 +194,6 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation,
        return -1;
     }
 
-/* XXX - signal setup duplicated in sudo.c */
     /*
      * Signal setup:
      * Ignore keyboard-generated signals so the user cannot interrupt
index bf3e740e943f1141688eb663999970b7879f79f2..2c8d0be8a7fd4b7741ef7f2c1748200421fad0ed 100644 (file)
@@ -105,12 +105,10 @@ struct user_details user_details;
 #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;
@@ -134,20 +132,6 @@ main(int argc, char *argv[], char *envp[])
     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();
index 347eed94cb97e71f12391de48e61e04fb93f62d3..f9c8751baa4aa15633e18c67d1f0b842360b58c9 100644 (file)
@@ -55,7 +55,6 @@
 
 #include "sudo.h"
 
-extern sigaction_t saved_sa_int, saved_sa_quit, saved_sa_tstp;
 extern char **environ;
 
 static char *find_editor();
@@ -211,9 +210,6 @@ sudo_edit(int argc, char **argv, char **envp)
        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.
@@ -225,8 +221,6 @@ sudo_edit(int argc, char **argv, char **envp)
        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);