diff options
author | Matt Johnston <matt@ucc.asn.au> | 2008-01-13 03:55:59 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2008-01-13 03:55:59 +0000 |
commit | bb0548b3b00ca1b0b06e4d0ccf6cb794337eb192 (patch) | |
tree | 9692d7d32f6e274634af9345f79c1d436b38aed8 /svr-authpasswd.c | |
parent | 25554bc331cc684c3521b3c3ed4c0659c454d5df (diff) |
Make a copy of passwd fields since getpwnam()'s retval isn't safe to keep
--HG--
extra : convert_revision : 295b11312e327fe6c4f33512674ea4a1a9790344
Diffstat (limited to 'svr-authpasswd.c')
-rw-r--r-- | svr-authpasswd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/svr-authpasswd.c b/svr-authpasswd.c index 5be1e2a..53550a2 100644 --- a/svr-authpasswd.c +++ b/svr-authpasswd.c @@ -46,10 +46,10 @@ void svr_auth_password() { unsigned int changepw; - passwdcrypt = ses.authstate.pw->pw_passwd; + passwdcrypt = ses.authstate.pw_passwd; #ifdef HAVE_SHADOW_H /* get the shadow password if possible */ - spasswd = getspnam(ses.authstate.printableuser); + spasswd = getspnam(ses.authstate.pw_name); if (spasswd != NULL && spasswd->sp_pwdp != NULL) { passwdcrypt = spasswd->sp_pwdp; } @@ -65,7 +65,7 @@ void svr_auth_password() { * in auth.c */ if (passwdcrypt[0] == '\0') { dropbear_log(LOG_WARNING, "user '%s' has blank password, rejected", - ses.authstate.printableuser); + ses.authstate.pw_name); send_msg_userauth_failure(0, 1); return; } @@ -89,13 +89,13 @@ void svr_auth_password() { /* successful authentication */ dropbear_log(LOG_NOTICE, "password auth succeeded for '%s' from %s", - ses.authstate.printableuser, + ses.authstate.pw_name, svr_ses.addrstring); send_msg_userauth_success(); } else { dropbear_log(LOG_WARNING, "bad password attempt for '%s' from %s", - ses.authstate.printableuser, + ses.authstate.pw_name, svr_ses.addrstring); send_msg_userauth_failure(0, 1); } |