From: Todd C. Miller Date: Fri, 12 May 2017 16:02:18 +0000 (-0600) Subject: Remove use of non-standard sigaction_t X-Git-Tag: SUDO_1_8_21^2~82 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d979898e71f1738eb4325a0da8705cac9119be3c;p=sudo Remove use of non-standard sigaction_t --- diff --git a/config.h.in b/config.h.in index ef864e1aa..0283f24c8 100644 --- a/config.h.in +++ b/config.h.in @@ -627,9 +627,6 @@ /* 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 diff --git a/configure b/configure index bbb466764..ae9d434c9 100755 --- 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 -#include -" -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 diff --git a/configure.ac b/configure.ac index 3a426108d..15f0c930f 100644 --- a/configure.ac +++ b/configure.ac @@ -2355,8 +2355,6 @@ AC_CHECK_TYPE([clockid_t], [], [AC_DEFINE(clockid_t, int)], [#include ]) AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include #include ]) -AC_CHECK_TYPES([sigaction_t], [], [], [#include -#include ]) AC_CHECK_TYPES([struct in6_addr], [], [], [#include #include ]) AC_TYPE_LONG_LONG_INT diff --git a/include/sudo_compat.h b/include/sudo_compat.h index f265123a6..bbf8736a9 100644 --- a/include/sudo_compat.h +++ b/include/sudo_compat.h @@ -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 */ diff --git a/lib/util/term.c b/lib/util/term.c index ac5c096ef..354e3c907 100644 --- a/lib/util/term.c +++ b/lib/util/term.c @@ -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; /* diff --git a/plugins/sudoers/auth/bsdauth.c b/plugins/sudoers/auth/bsdauth.c index 412f476eb..001ee7c84 100644 --- a/plugins/sudoers/auth/bsdauth.c +++ b/plugins/sudoers/auth/bsdauth.c @@ -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) diff --git a/plugins/sudoers/auth/sudo_auth.c b/plugins/sudoers/auth/sudo_auth.c index 7fca030f4..058a12508 100644 --- a/plugins/sudoers/auth/sudo_auth.c +++ b/plugins/sudoers/auth/sudo_auth.c @@ -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. */ diff --git a/plugins/sudoers/sudoreplay.c b/plugins/sudoers/sudoreplay.c index 11e24e9f9..5deb17d06 100644 --- a/plugins/sudoers/sudoreplay.c +++ b/plugins/sudoers/sudoreplay.c @@ -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) diff --git a/plugins/sudoers/visudo.c b/plugins/sudoers/visudo.c index 4793d5406..3a4c8dca4 100644 --- a/plugins/sudoers/visudo.c +++ b/plugins/sudoers/visudo.c @@ -862,7 +862,7 @@ whatnow(void) static void setup_signals(void) { - sigaction_t sa; + struct sigaction sa; debug_decl(setup_signals, SUDOERS_DEBUG_UTIL) /* diff --git a/src/exec_monitor.c b/src/exec_monitor.c index 3ae901cfb..6d28a296c 100644 --- a/src/exec_monitor.c +++ b/src/exec_monitor.c @@ -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); diff --git a/src/exec_nopty.c b/src/exec_nopty.c index 4daa4a4d6..3c14c46e8 100644 --- a/src/exec_nopty.c +++ b/src/exec_nopty.c @@ -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); diff --git a/src/exec_pty.c b/src/exec_pty.c index 3958b7d59..f614c9c62 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -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) diff --git a/src/signal.c b/src/signal.c index d6fc5129f..f0af73859 100644 --- a/src/signal.c +++ b/src/signal.c @@ -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 */ diff --git a/src/sudo.c b/src/sudo.c index b5a081d02..6aea86448 100644 --- a/src/sudo.c +++ b/src/sudo.c @@ -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); diff --git a/src/tcsetpgrp_nobg.c b/src/tcsetpgrp_nobg.c index f982cef9e..9cac67835 100644 --- a/src/tcsetpgrp_nobg.c +++ b/src/tcsetpgrp_nobg.c @@ -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; /* diff --git a/src/tgetpass.c b/src/tgetpass.c index c44ab5f5b..53c08b261 100644 --- a/src/tgetpass.c +++ b/src/tgetpass.c @@ -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];