From 29171e9f5c094d912bd27c60b2973617e05cc785 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 20 May 2007 15:20:08 +1000 Subject: - (dtucker) [auth-pam.c] malloc+memset -> calloc. Patch from ldv at altlinux.org. --- auth-pam.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'auth-pam.c') diff --git a/auth-pam.c b/auth-pam.c index c08d47229..bfd8f3270 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -686,8 +686,7 @@ sshpam_init_ctx(Authctxt *authctxt) return (NULL); } - ctxt = xmalloc(sizeof *ctxt); - memset(ctxt, 0, sizeof(*ctxt)); + ctxt = xcalloc(1, sizeof *ctxt); /* Start the authentication thread */ if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, socks) == -1) { @@ -1130,9 +1129,8 @@ sshpam_passwd_conv(int n, sshpam_const struct pam_message **msg, if (n <= 0 || n > PAM_MAX_NUM_MSG) return (PAM_CONV_ERR); - if ((reply = malloc(n * sizeof(*reply))) == NULL) + if ((reply = calloc(n, sizeof(*reply))) == NULL) return (PAM_CONV_ERR); - memset(reply, 0, n * sizeof(*reply)); for (i = 0; i < n; ++i) { switch (PAM_MSG_MEMBER(msg, i, msg_style)) { -- cgit v1.2.3 From 2216471510b3de30cb9df3e81bdfa267152ecd39 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 20 May 2007 15:26:07 +1000 Subject: - (dtucker) [auth-pam.c] Return empty string if fgets fails in sshpam_tty_conv. Patch from ldv at altlinux.org. --- ChangeLog | 4 +++- auth-pam.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'auth-pam.c') diff --git a/ChangeLog b/ChangeLog index eb9a6ebea..a2c408552 100644 --- a/ChangeLog +++ b/ChangeLog @@ -38,6 +38,8 @@ djm owes me a vb and a tism cd for breaking ssh compilation - (dtucker) [auth-pam.c] malloc+memset -> calloc. Patch from ldv at altlinux.org. + - (dtucker) [auth-pam.c] Return empty string if fgets fails in + sshpam_tty_conv. Patch from ldv at altlinux.org. 20070509 - (tim) [configure.ac] Bug #1287: Add missing test for ucred.h. @@ -2938,4 +2940,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4669 2007/05/20 05:20:08 dtucker Exp $ +$Id: ChangeLog,v 1.4670 2007/05/20 05:26:07 dtucker Exp $ diff --git a/auth-pam.c b/auth-pam.c index bfd8f3270..35aecbdb4 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -984,7 +984,8 @@ sshpam_tty_conv(int n, sshpam_const struct pam_message **msg, break; case PAM_PROMPT_ECHO_ON: fprintf(stderr, "%s\n", PAM_MSG_MEMBER(msg, i, msg)); - fgets(input, sizeof input, stdin); + if (fgets(input, sizeof input, stdin) == NULL) + input[0] = '\0'; if ((reply[i].resp = strdup(input)) == NULL) goto fail; reply[i].resp_retcode = PAM_SUCCESS; -- cgit v1.2.3 From 57d4ca96819651354bdff706df08b3d70a054439 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 10 Aug 2007 14:32:34 +1000 Subject: - (dtucker) [auth-pam.c] Use sigdie here too. ok djm@ --- ChangeLog | 5 ++++- auth-pam.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'auth-pam.c') diff --git a/ChangeLog b/ChangeLog index c0ea7f73a..a5cfdea79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20070810 + - (dtucker) [auth-pam.c] Use sigdie here too. ok djm@ + 20070809 - (dtucker) [openbsd-compat/port-aix.c] Comment typo. - (dtucker) [README.platform] Document the interaction between PermitRootLogin @@ -3142,4 +3145,4 @@ OpenServer 6 and add osr5bigcrypt support so when someone migrates passwords between UnixWare and OpenServer they will still work. OK dtucker@ -$Id: ChangeLog,v 1.4722 2007/08/09 05:03:23 dtucker Exp $ +$Id: ChangeLog,v 1.4723 2007/08/10 04:32:34 dtucker Exp $ diff --git a/auth-pam.c b/auth-pam.c index 35aecbdb4..a07f1fe77 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -161,9 +161,9 @@ sshpam_sigchld_handler(int sig) WTERMSIG(sshpam_thread_status) == SIGTERM) return; /* terminated by pthread_cancel */ if (!WIFEXITED(sshpam_thread_status)) - fatal("PAM: authentication thread exited unexpectedly"); + sigdie("PAM: authentication thread exited unexpectedly"); if (WEXITSTATUS(sshpam_thread_status) != 0) - fatal("PAM: authentication thread exited uncleanly"); + sigdie("PAM: authentication thread exited uncleanly"); } /* ARGSUSED */ -- cgit v1.2.3