comparison svr-authpasswd.c @ 53:0fe267cc9dee

Be a bit safer with reentrant pw_name
author Matt Johnston <matt@ucc.asn.au>
date Sun, 08 Aug 2004 16:41:26 +0000
parents f789045062e6
children a48ba599292a
comparison
equal deleted inserted replaced
52:c8fcd4841956 53:0fe267cc9dee
48 unsigned char changepw; 48 unsigned char changepw;
49 49
50 passwdcrypt = ses.authstate.pw->pw_passwd; 50 passwdcrypt = ses.authstate.pw->pw_passwd;
51 #ifdef HAVE_SHADOW_H 51 #ifdef HAVE_SHADOW_H
52 /* get the shadow password if possible */ 52 /* get the shadow password if possible */
53 spasswd = getspnam(ses.authstate.pw->pw_name); 53 spasswd = getspnam(ses.authstate.printableuser);
54 if (spasswd != NULL && spasswd->sp_pwdp != NULL) { 54 if (spasswd != NULL && spasswd->sp_pwdp != NULL) {
55 passwdcrypt = spasswd->sp_pwdp; 55 passwdcrypt = spasswd->sp_pwdp;
56 } 56 }
57 #endif 57 #endif
58 58