Mercurial > dropbear
comparison common-session.c @ 676:0edf08895a33
Return immediate success for blank passwords if allowed
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 09 May 2012 22:37:04 +0800 |
parents | a98a2138364a |
children | 2e573f39b88e |
comparison
equal
deleted
inserted
replaced
675:dfdb9d9189ff | 676:0edf08895a33 |
---|---|
451 ses.authstate.pw_uid = pw->pw_uid; | 451 ses.authstate.pw_uid = pw->pw_uid; |
452 ses.authstate.pw_gid = pw->pw_gid; | 452 ses.authstate.pw_gid = pw->pw_gid; |
453 ses.authstate.pw_name = m_strdup(pw->pw_name); | 453 ses.authstate.pw_name = m_strdup(pw->pw_name); |
454 ses.authstate.pw_dir = m_strdup(pw->pw_dir); | 454 ses.authstate.pw_dir = m_strdup(pw->pw_dir); |
455 ses.authstate.pw_shell = m_strdup(pw->pw_shell); | 455 ses.authstate.pw_shell = m_strdup(pw->pw_shell); |
456 ses.authstate.pw_passwd = m_strdup(pw->pw_passwd); | 456 { |
457 } | 457 char *passwd_crypt = pw->pw_passwd; |
458 | 458 #ifdef HAVE_SHADOW_H |
459 /* get the shadow password if possible */ | |
460 struct spwd *spasswd = getspnam(ses.authstate.pw_name); | |
461 if (spasswd && spasswd->sp_pwdp) { | |
462 passwd_crypt = spasswd->sp_pwdp; | |
463 } | |
464 #endif | |
465 ses.authstate.pw_passwd = m_strdup(passwd_crypt); | |
466 } | |
467 } | |
468 |