diff options
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/auth-pam.c b/auth-pam.c index d3f400bc3..5a3ba09b4 100644 --- a/auth-pam.c +++ b/auth-pam.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include <errno.h> | 56 | #include <errno.h> |
57 | #include <signal.h> | 57 | #include <signal.h> |
58 | #include <stdarg.h> | 58 | #include <stdarg.h> |
59 | #include <stdlib.h> | ||
59 | #include <string.h> | 60 | #include <string.h> |
60 | #include <unistd.h> | 61 | #include <unistd.h> |
61 | 62 | ||
@@ -99,6 +100,7 @@ extern char *__progname; | |||
99 | #include "servconf.h" | 100 | #include "servconf.h" |
100 | #include "ssh2.h" | 101 | #include "ssh2.h" |
101 | #include "auth-options.h" | 102 | #include "auth-options.h" |
103 | #include "misc.h" | ||
102 | #ifdef GSSAPI | 104 | #ifdef GSSAPI |
103 | #include "ssh-gss.h" | 105 | #include "ssh-gss.h" |
104 | #endif | 106 | #endif |
@@ -150,12 +152,12 @@ static struct pam_ctxt *cleanup_ctxt; | |||
150 | */ | 152 | */ |
151 | 153 | ||
152 | static int sshpam_thread_status = -1; | 154 | static int sshpam_thread_status = -1; |
153 | static mysig_t sshpam_oldsig; | 155 | static sshsig_t sshpam_oldsig; |
154 | 156 | ||
155 | static void | 157 | static void |
156 | sshpam_sigchld_handler(int sig) | 158 | sshpam_sigchld_handler(int sig) |
157 | { | 159 | { |
158 | signal(SIGCHLD, SIG_DFL); | 160 | ssh_signal(SIGCHLD, SIG_DFL); |
159 | if (cleanup_ctxt == NULL) | 161 | if (cleanup_ctxt == NULL) |
160 | return; /* handler called after PAM cleanup, shouldn't happen */ | 162 | return; /* handler called after PAM cleanup, shouldn't happen */ |
161 | if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, WNOHANG) | 163 | if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, WNOHANG) |
@@ -207,7 +209,7 @@ pthread_create(sp_pthread_t *thread, const void *attr, | |||
207 | *thread = pid; | 209 | *thread = pid; |
208 | close(ctx->pam_csock); | 210 | close(ctx->pam_csock); |
209 | ctx->pam_csock = -1; | 211 | ctx->pam_csock = -1; |
210 | sshpam_oldsig = signal(SIGCHLD, sshpam_sigchld_handler); | 212 | sshpam_oldsig = ssh_signal(SIGCHLD, sshpam_sigchld_handler); |
211 | return (0); | 213 | return (0); |
212 | } | 214 | } |
213 | } | 215 | } |
@@ -215,7 +217,7 @@ pthread_create(sp_pthread_t *thread, const void *attr, | |||
215 | static int | 217 | static int |
216 | pthread_cancel(sp_pthread_t thread) | 218 | pthread_cancel(sp_pthread_t thread) |
217 | { | 219 | { |
218 | signal(SIGCHLD, sshpam_oldsig); | 220 | ssh_signal(SIGCHLD, sshpam_oldsig); |
219 | return (kill(thread, SIGTERM)); | 221 | return (kill(thread, SIGTERM)); |
220 | } | 222 | } |
221 | 223 | ||
@@ -227,7 +229,7 @@ pthread_join(sp_pthread_t thread, void **value) | |||
227 | 229 | ||
228 | if (sshpam_thread_status != -1) | 230 | if (sshpam_thread_status != -1) |
229 | return (sshpam_thread_status); | 231 | return (sshpam_thread_status); |
230 | signal(SIGCHLD, sshpam_oldsig); | 232 | ssh_signal(SIGCHLD, sshpam_oldsig); |
231 | while (waitpid(thread, &status, 0) == -1) { | 233 | while (waitpid(thread, &status, 0) == -1) { |
232 | if (errno == EINTR) | 234 | if (errno == EINTR) |
233 | continue; | 235 | continue; |
@@ -299,7 +301,7 @@ sshpam_chauthtok_ruid(pam_handle_t *pamh, int flags) | |||
299 | # define pam_chauthtok(a,b) (sshpam_chauthtok_ruid((a), (b))) | 301 | # define pam_chauthtok(a,b) (sshpam_chauthtok_ruid((a), (b))) |
300 | #endif | 302 | #endif |
301 | 303 | ||
302 | void | 304 | static void |
303 | sshpam_password_change_required(int reqd) | 305 | sshpam_password_change_required(int reqd) |
304 | { | 306 | { |
305 | extern struct sshauthopt *auth_opts; | 307 | extern struct sshauthopt *auth_opts; |