diff options
author | Damien Miller <djm@mindrot.org> | 2003-09-16 16:00:52 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-09-16 16:00:52 +1000 |
commit | 04a1d8d67df05ebd44aad49a2e28c2bd0184fec5 (patch) | |
tree | c4f6834ea3feb020d4dedf3071c19d48515c724f /auth-pam.c | |
parent | 5502e5895d0641991e2ff1f530221b928ca8edca (diff) |
- (djm) Banish sprintf from auth-pam.c. Patch from bal
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/auth-pam.c b/auth-pam.c index 806c80860..754cbf6df 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" |
34 | RCSID("$Id: auth-pam.c,v 1.72 2003/09/13 12:12:11 dtucker Exp $"); | 34 | RCSID("$Id: auth-pam.c,v 1.72.2.1 2003/09/16 06:00:52 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) | |||
672 | int | 672 | int |
673 | do_pam_putenv(char *name, char *value) | 673 | do_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 | ||