diff options
author | Damien Miller <djm@mindrot.org> | 2003-09-17 07:24:25 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-09-17 07:24:25 +1000 |
commit | f2728099baa0fe4e6f1a8bfa321aefbf412f6543 (patch) | |
tree | b5e00c2c8f345e512508732c1b4f3c241b8decb9 /auth-pam.c | |
parent | e12104839298a45ecba1dc0059494229a1bf51f3 (diff) |
- (djm) Sync with V_3_7 branch
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -31,7 +31,7 @@ /* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ #include "includes.h" -RCSID("$Id: auth-pam.c,v 1.72 2003/09/13 12:12:11 dtucker Exp $"); +RCSID("$Id: auth-pam.c,v 1.73 2003/09/16 21:24:25 djm Exp $"); #ifdef USE_PAM #include <security/pam_appl.h> @@ -672,17 +672,19 @@ do_pam_chauthtok(void) int do_pam_putenv(char *name, char *value) { - char *compound; int ret = 1; - #ifdef HAVE_PAM_PUTENV - compound = xmalloc(strlen(name)+strlen(value)+2); - if (compound) { - sprintf(compound,"%s=%s",name,value); - ret = pam_putenv(sshpam_handle,compound); - xfree(compound); - } + char *compound; + size_t len; + + len = strlen(name) + strlen(value) + 2; + compound = xmalloc(len); + + snprintf(compound, len, "%s=%s", name, value); + ret = pam_putenv(sshpam_handle, compound); + xfree(compound); #endif + return (ret); } |