summaryrefslogtreecommitdiff
path: root/auth-pam.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-09-17 07:24:25 +1000
committerDamien Miller <djm@mindrot.org>2003-09-17 07:24:25 +1000
commitf2728099baa0fe4e6f1a8bfa321aefbf412f6543 (patch)
treeb5e00c2c8f345e512508732c1b4f3c241b8decb9 /auth-pam.c
parente12104839298a45ecba1dc0059494229a1bf51f3 (diff)
- (djm) Sync with V_3_7 branch
Diffstat (limited to 'auth-pam.c')
-rw-r--r--auth-pam.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/auth-pam.c b/auth-pam.c
index 806c80860..22706c5d6 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -31,7 +31,7 @@
31 31
32/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ 32/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */
33#include "includes.h" 33#include "includes.h"
34RCSID("$Id: auth-pam.c,v 1.72 2003/09/13 12:12:11 dtucker Exp $"); 34RCSID("$Id: auth-pam.c,v 1.73 2003/09/16 21:24:25 djm Exp $");
35 35
36#ifdef USE_PAM 36#ifdef USE_PAM
37#include <security/pam_appl.h> 37#include <security/pam_appl.h>
@@ -672,17 +672,19 @@ do_pam_chauthtok(void)
672int 672int
673do_pam_putenv(char *name, char *value) 673do_pam_putenv(char *name, char *value)
674{ 674{
675 char *compound;
676 int ret = 1; 675 int ret = 1;
677
678#ifdef HAVE_PAM_PUTENV 676#ifdef HAVE_PAM_PUTENV
679 compound = xmalloc(strlen(name)+strlen(value)+2); 677 char *compound;
680 if (compound) { 678 size_t len;
681 sprintf(compound,"%s=%s",name,value); 679
682 ret = pam_putenv(sshpam_handle,compound); 680 len = strlen(name) + strlen(value) + 2;
683 xfree(compound); 681 compound = xmalloc(len);
684 } 682
683 snprintf(compound, len, "%s=%s", name, value);
684 ret = pam_putenv(sshpam_handle, compound);
685 xfree(compound);
685#endif 686#endif
687
686 return (ret); 688 return (ret);
687} 689}
688 690