diff options
author | Todd C. Miller <Todd.Miller@courtesan.com> | 2002-01-22 03:37:55 +0000 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@courtesan.com> | 2002-01-22 03:37:55 +0000 |
commit | cb0ea6261f8e8fa00554a7e92d0c1f4d6204ca26 (patch) | |
tree | e78b4db0656bc7a1d7cc3891d4ffafe5360ba68b /auth | |
parent | d9949612799645dcd7927ce24d9e5298bbb5523e (diff) | |
download | sudo-cb0ea6261f8e8fa00554a7e92d0c1f4d6204ca26.tar.gz |
Use sigaction() not signal()
Diffstat (limited to 'auth')
-rw-r--r-- | auth/bsdauth.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/auth/bsdauth.c b/auth/bsdauth.c index 232bb7ed7..344176045 100644 --- a/auth/bsdauth.c +++ b/auth/bsdauth.c @@ -57,6 +57,7 @@ #endif /* HAVE_UNISTD_H */ #include <ctype.h> #include <pwd.h> +#include <signal.h> #include <login_cap.h> #include <bsd_auth.h> @@ -114,12 +115,15 @@ bsdauth_verify(pw, prompt, auth) char *s, *pass; size_t len; int authok = 0; - sig_t childkiller; + sigaction_t sa, osa; auth_session_t *as = (auth_session_t *) auth->data; extern int nil_pw; /* save old signal handler */ - childkiller = signal(SIGCHLD, SIG_DFL); + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_RESTART; + sa.sa_handler = SIG_DFL; + (void) sigaction(SIGCHLD, &sa, &osa); /* * If there is a challenge then print that instead of the normal @@ -160,7 +164,7 @@ bsdauth_verify(pw, prompt, auth) } /* restore old signal handler */ - (void)signal(SIGCHLD, childkiller); + (void) sigaction(SIGCHLD, &osa, NULL); if (authok) return(AUTH_SUCCESS); |