]> granicus.if.org Git - sudo/commitdiff
Remove use of non-standard sigaction_t
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 12 May 2017 16:02:18 +0000 (10:02 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 12 May 2017 16:02:18 +0000 (10:02 -0600)
16 files changed:
config.h.in
configure
configure.ac
include/sudo_compat.h
lib/util/term.c
plugins/sudoers/auth/bsdauth.c
plugins/sudoers/auth/sudo_auth.c
plugins/sudoers/sudoreplay.c
plugins/sudoers/visudo.c
src/exec_monitor.c
src/exec_nopty.c
src/exec_pty.c
src/signal.c
src/sudo.c
src/tcsetpgrp_nobg.c
src/tgetpass.c

index ef864e1aae943a633a8296c878e95e0fff572b92..0283f24c81e62d6087e57a3795b21fdbafd35ad1 100644 (file)
 /* Define to 1 if you have the `sig2str' function. */
 #undef HAVE_SIG2STR
 
-/* Define to 1 if the system has the type `sigaction_t'. */
-#undef HAVE_SIGACTION_T
-
 /* Define to 1 if you use S/Key. */
 #undef HAVE_SKEY
 
index bbb466764a28d3af7a735da1ca1ce39f6dba7738..ae9d434c90661ddb0c139b0feac45a63ce16ccc7 100755 (executable)
--- a/configure
+++ b/configure
@@ -18120,18 +18120,6 @@ if test "x$ac_cv_type_sig_atomic_t" = xyes; then :
 else
   $as_echo "#define sig_atomic_t int" >>confdefs.h
 
-fi
-
-ac_fn_c_check_type "$LINENO" "sigaction_t" "ac_cv_type_sigaction_t" "#include <sys/types.h>
-#include <signal.h>
-"
-if test "x$ac_cv_type_sigaction_t" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SIGACTION_T 1
-_ACEOF
-
-
 fi
 
 ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" "#include <sys/types.h>
index 3a426108d793cc9a708d73ded83bc82f80f27ce3..15f0c930f34d63893fff4c1c22a8e61cebb5ae68 100644 (file)
@@ -2355,8 +2355,6 @@ AC_CHECK_TYPE([clockid_t], [], [AC_DEFINE(clockid_t, int)], [#include <sys/types
 #include <time.h>])
 AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys/types.h>
 #include <signal.h>])
-AC_CHECK_TYPES([sigaction_t], [], [], [#include <sys/types.h>
-#include <signal.h>])
 AC_CHECK_TYPES([struct in6_addr], [], [], [#include <sys/types.h>
 #include <netinet/in.h>])
 AC_TYPE_LONG_LONG_INT
index f265123a6b23f8014a8734be830cd9d8c8029728..bbf8736a9df86f380d126a8e5265190f8e2e96de 100644 (file)
@@ -248,13 +248,6 @@ __dso_public int isblank(int);
 # define HAVE_INNETGR 1
 #endif /* HAVE__INNETGR */
 
-/*
- * Add IRIX-like sigaction_t for those without it.
- */
-#ifndef HAVE_SIGACTION_T
-typedef struct sigaction sigaction_t;
-#endif
-
 /*
  * The nitems macro may be defined in sys/param.h
  */
index ac5c096ef8d411ea846e160452f6d08225f9e8bf..354e3c907f7b327d7d5fe119a3a086fedbea0196 100644 (file)
@@ -81,7 +81,7 @@ sigttou(int signo)
 static int
 tcsetattr_nobg(int fd, int flags, struct termios *tp)
 {
-    sigaction_t sa, osa;
+    struct sigaction sa, osa;
     int rc;
 
     /*
index 412f476eb7b6cb09944e62fc00765161c3fb1737..001ee7c842ba409c8cb4f38ed8e0bb3354248cca 100644 (file)
@@ -104,7 +104,7 @@ bsdauth_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_con
     char *s;
     size_t len;
     int authok = 0;
-    sigaction_t sa, osa;
+    struct sigaction sa, osa;
     auth_session_t *as = ((struct bsdauth_state *) auth->data)->as;
     debug_decl(bsdauth_verify, SUDOERS_DEBUG_AUTH)
 
index 7fca030f4a68054d2fd348132476611f58b33de3..058a12508e4e48945981295c5b553e21feb480d6 100644 (file)
@@ -216,7 +216,7 @@ verify_user(struct passwd *pw, char *prompt, int validated,
     int ret, status, success = AUTH_FAILURE;
     sudo_auth *auth;
     sigset_t mask, omask;
-    sigaction_t sa, saved_sigtstp;
+    struct sigaction sa, saved_sigtstp;
     debug_decl(verify_user, SUDOERS_DEBUG_AUTH)
 
     /* Make sure we have at least one auth method. */
index 11e24e9f91b88e8d5a9b5638f046dacb28dbdb02..5deb17d0686e9ba1bb9cd3bea86b02e20ae679b6 100644 (file)
@@ -381,7 +381,7 @@ replay_session(const double max_wait, const char *decimal)
     bool interactive;
     struct write_closure wc;
     char buf[LINE_MAX];
-    sigaction_t sa;
+    struct sigaction sa;
     int idx;
     debug_decl(replay_session, SUDO_DEBUG_UTIL)
 
index 4793d5406328a78d8799e9125cb5e5e010a932d2..3a4c8dca404d63a6099fbb7c258f135bbc881e6c 100644 (file)
@@ -862,7 +862,7 @@ whatnow(void)
 static void
 setup_signals(void)
 {
-    sigaction_t sa;
+    struct sigaction sa;
     debug_decl(setup_signals, SUDOERS_DEBUG_UTIL)
 
     /*
index 3ae901cfbdb7dee40dcc56d21a6ba162cfc4a72a..6d28a296c5c45ee5df6a1f96fe9f784dfdba2aa5 100644 (file)
@@ -495,7 +495,7 @@ exec_monitor(struct command_details *details, sigset_t *oset,
 {
     struct monitor_closure mc = { 0 };
     struct command_status cstat;
-    sigaction_t sa;
+    struct sigaction sa;
     int errpipe[2];
     debug_decl(exec_monitor, SUDO_DEBUG_EXEC);
 
index 4daa4a4d60583e4b7f40893a26368e8a47efe27d..3c14c46e8024abacf3398a65ffe41c347d609220 100644 (file)
@@ -469,7 +469,7 @@ handle_sigchld_nopty(struct exec_closure_nopty *ec)
         * resume, potentially stopping sudo with SIGTTOU while the command
         * continues to run.
         */
-       sigaction_t sa, osa;
+       struct sigaction sa, osa;
        pid_t saved_pgrp = -1;
        int fd, signo = WSTOPSIG(status);
 
index 3958b7d593e4c48cb4012cd4c5bfe34feae39c25..f614c9c62461b901e46599ab8af2613d20c555cb 100644 (file)
@@ -392,7 +392,7 @@ static int
 suspend_sudo(int signo, pid_t ppgrp)
 {
     char signame[SIG2STR_MAX];
-    sigaction_t sa, osa;
+    struct sigaction sa, osa;
     int ret = 0;
     debug_decl(suspend_sudo, SUDO_DEBUG_EXEC);
 
@@ -1111,7 +1111,7 @@ exec_pty(struct command_details *details, struct command_status *cstat)
     struct exec_closure_pty ec = { 0 };
     struct plugin_container *plugin;
     sigset_t set, oset;
-    sigaction_t sa;
+    struct sigaction sa;
     pid_t ppgrp;
     int sv[2];
     debug_decl(exec_pty, SUDO_DEBUG_EXEC)
index d6fc5129f3404d25a1d8d4d741f89b29e2af02eb..f0af73859af91602f6370bbc7008d4de5b05395f 100644 (file)
@@ -36,7 +36,7 @@
 static struct signal_state {
     int signo;
     int restore;
-    sigaction_t sa;
+    struct sigaction sa;
 } saved_signals[] = {
     { SIGALRM },       /* SAVED_SIGALRM */
     { SIGCHLD },       /* SAVED_SIGCHLD */
index b5a081d02d073292602ba7d8f84a8abb0e3fe274..6aea86448ca3fa839cb399d9e7446505bf1a50b7 100644 (file)
@@ -318,7 +318,7 @@ main(int argc, char *argv[], char *envp[])
      * signal.  However, we want to avoid having sudo dump core itself.
      */
     if (WIFSIGNALED(status)) {
-       sigaction_t sa;
+       struct sigaction sa;
 
        if (WCOREDUMP(status))
            disable_coredump(false);
index f982cef9e5224aa36976e4a57b5da51a9c78ea91..9cac67835b8f8f48e9071c6da9bd9528bd4d0f1c 100644 (file)
@@ -50,7 +50,7 @@ sigttou(int signo)
 int
 tcsetpgrp_nobg(int fd, pid_t pgrp_id)
 {
-    sigaction_t sa, osa;
+    struct sigaction sa, osa;
     int rc;
 
     /*
index c44ab5f5b17d2162bcb05aa6c84c45c3db81f965..53c08b261604e313b19b3e136a2deae7f7282326 100644 (file)
@@ -84,8 +84,8 @@ char *
 tgetpass(const char *prompt, int timeout, int flags,
     struct sudo_conv_callback *callback)
 {
-    sigaction_t sa, savealrm, saveint, savehup, savequit, saveterm;
-    sigaction_t savetstp, savettin, savettou;
+    struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm;
+    struct sigaction savetstp, savettin, savettou;
     char *pass;
     static const char *askpass;
     static char buf[SUDO_CONV_REPL_MAX + 1];