Remove use of non-standard sigaction_t

This commit is contained in:
Todd C. Miller
2017-05-12 10:02:18 -06:00
parent b5c88e52b1
commit d979898e71
16 changed files with 14 additions and 38 deletions

View File

@@ -627,9 +627,6 @@
/* Define to 1 if you have the `sig2str' function. */ /* Define to 1 if you have the `sig2str' function. */
#undef HAVE_SIG2STR #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. */ /* Define to 1 if you use S/Key. */
#undef HAVE_SKEY #undef HAVE_SKEY

12
configure vendored
View File

@@ -18120,18 +18120,6 @@ if test "x$ac_cv_type_sig_atomic_t" = xyes; then :
else else
$as_echo "#define sig_atomic_t int" >>confdefs.h $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 fi
ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" "#include <sys/types.h> ac_fn_c_check_type "$LINENO" "struct in6_addr" "ac_cv_type_struct_in6_addr" "#include <sys/types.h>

View File

@@ -2355,8 +2355,6 @@ AC_CHECK_TYPE([clockid_t], [], [AC_DEFINE(clockid_t, int)], [#include <sys/types
#include <time.h>]) #include <time.h>])
AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys/types.h> AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys/types.h>
#include <signal.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> AC_CHECK_TYPES([struct in6_addr], [], [], [#include <sys/types.h>
#include <netinet/in.h>]) #include <netinet/in.h>])
AC_TYPE_LONG_LONG_INT AC_TYPE_LONG_LONG_INT

View File

@@ -248,13 +248,6 @@ __dso_public int isblank(int);
# define HAVE_INNETGR 1 # define HAVE_INNETGR 1
#endif /* HAVE__INNETGR */ #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 * The nitems macro may be defined in sys/param.h
*/ */

View File

@@ -81,7 +81,7 @@ sigttou(int signo)
static int static int
tcsetattr_nobg(int fd, int flags, struct termios *tp) tcsetattr_nobg(int fd, int flags, struct termios *tp)
{ {
sigaction_t sa, osa; struct sigaction sa, osa;
int rc; int rc;
/* /*

View File

@@ -104,7 +104,7 @@ bsdauth_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_con
char *s; char *s;
size_t len; size_t len;
int authok = 0; int authok = 0;
sigaction_t sa, osa; struct sigaction sa, osa;
auth_session_t *as = ((struct bsdauth_state *) auth->data)->as; auth_session_t *as = ((struct bsdauth_state *) auth->data)->as;
debug_decl(bsdauth_verify, SUDOERS_DEBUG_AUTH) debug_decl(bsdauth_verify, SUDOERS_DEBUG_AUTH)

View File

@@ -216,7 +216,7 @@ verify_user(struct passwd *pw, char *prompt, int validated,
int ret, status, success = AUTH_FAILURE; int ret, status, success = AUTH_FAILURE;
sudo_auth *auth; sudo_auth *auth;
sigset_t mask, omask; sigset_t mask, omask;
sigaction_t sa, saved_sigtstp; struct sigaction sa, saved_sigtstp;
debug_decl(verify_user, SUDOERS_DEBUG_AUTH) debug_decl(verify_user, SUDOERS_DEBUG_AUTH)
/* Make sure we have at least one auth method. */ /* Make sure we have at least one auth method. */

View File

@@ -381,7 +381,7 @@ replay_session(const double max_wait, const char *decimal)
bool interactive; bool interactive;
struct write_closure wc; struct write_closure wc;
char buf[LINE_MAX]; char buf[LINE_MAX];
sigaction_t sa; struct sigaction sa;
int idx; int idx;
debug_decl(replay_session, SUDO_DEBUG_UTIL) debug_decl(replay_session, SUDO_DEBUG_UTIL)

View File

@@ -862,7 +862,7 @@ whatnow(void)
static void static void
setup_signals(void) setup_signals(void)
{ {
sigaction_t sa; struct sigaction sa;
debug_decl(setup_signals, SUDOERS_DEBUG_UTIL) debug_decl(setup_signals, SUDOERS_DEBUG_UTIL)
/* /*

View File

@@ -495,7 +495,7 @@ exec_monitor(struct command_details *details, sigset_t *oset,
{ {
struct monitor_closure mc = { 0 }; struct monitor_closure mc = { 0 };
struct command_status cstat; struct command_status cstat;
sigaction_t sa; struct sigaction sa;
int errpipe[2]; int errpipe[2];
debug_decl(exec_monitor, SUDO_DEBUG_EXEC); debug_decl(exec_monitor, SUDO_DEBUG_EXEC);

View File

@@ -469,7 +469,7 @@ handle_sigchld_nopty(struct exec_closure_nopty *ec)
* resume, potentially stopping sudo with SIGTTOU while the command * resume, potentially stopping sudo with SIGTTOU while the command
* continues to run. * continues to run.
*/ */
sigaction_t sa, osa; struct sigaction sa, osa;
pid_t saved_pgrp = -1; pid_t saved_pgrp = -1;
int fd, signo = WSTOPSIG(status); int fd, signo = WSTOPSIG(status);

View File

@@ -392,7 +392,7 @@ static int
suspend_sudo(int signo, pid_t ppgrp) suspend_sudo(int signo, pid_t ppgrp)
{ {
char signame[SIG2STR_MAX]; char signame[SIG2STR_MAX];
sigaction_t sa, osa; struct sigaction sa, osa;
int ret = 0; int ret = 0;
debug_decl(suspend_sudo, SUDO_DEBUG_EXEC); 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 exec_closure_pty ec = { 0 };
struct plugin_container *plugin; struct plugin_container *plugin;
sigset_t set, oset; sigset_t set, oset;
sigaction_t sa; struct sigaction sa;
pid_t ppgrp; pid_t ppgrp;
int sv[2]; int sv[2];
debug_decl(exec_pty, SUDO_DEBUG_EXEC) debug_decl(exec_pty, SUDO_DEBUG_EXEC)

View File

@@ -36,7 +36,7 @@
static struct signal_state { static struct signal_state {
int signo; int signo;
int restore; int restore;
sigaction_t sa; struct sigaction sa;
} saved_signals[] = { } saved_signals[] = {
{ SIGALRM }, /* SAVED_SIGALRM */ { SIGALRM }, /* SAVED_SIGALRM */
{ SIGCHLD }, /* SAVED_SIGCHLD */ { SIGCHLD }, /* SAVED_SIGCHLD */

View File

@@ -318,7 +318,7 @@ main(int argc, char *argv[], char *envp[])
* signal. However, we want to avoid having sudo dump core itself. * signal. However, we want to avoid having sudo dump core itself.
*/ */
if (WIFSIGNALED(status)) { if (WIFSIGNALED(status)) {
sigaction_t sa; struct sigaction sa;
if (WCOREDUMP(status)) if (WCOREDUMP(status))
disable_coredump(false); disable_coredump(false);

View File

@@ -50,7 +50,7 @@ sigttou(int signo)
int int
tcsetpgrp_nobg(int fd, pid_t pgrp_id) tcsetpgrp_nobg(int fd, pid_t pgrp_id)
{ {
sigaction_t sa, osa; struct sigaction sa, osa;
int rc; int rc;
/* /*

View File

@@ -84,8 +84,8 @@ char *
tgetpass(const char *prompt, int timeout, int flags, tgetpass(const char *prompt, int timeout, int flags,
struct sudo_conv_callback *callback) struct sudo_conv_callback *callback)
{ {
sigaction_t sa, savealrm, saveint, savehup, savequit, saveterm; struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm;
sigaction_t savetstp, savettin, savettou; struct sigaction savetstp, savettin, savettou;
char *pass; char *pass;
static const char *askpass; static const char *askpass;
static char buf[SUDO_CONV_REPL_MAX + 1]; static char buf[SUDO_CONV_REPL_MAX + 1];