diff --git a/svr-authpasswd.c b/svr-authpasswd.c
index f161b690d62d87c1fb57f050a535a873f1a69d0a..cc9e838bffc3bfe6439f3f3b5cc8047704b0e2b9 100644
--- a/svr-authpasswd.c
+++ b/svr-authpasswd.c
@@ -50,7 +50,7 @@ void svr_auth_password() {
 	passwdcrypt = ses.authstate.pw->pw_passwd;
 #ifdef HAVE_SHADOW_H
 	/* get the shadow password if possible */
-	spasswd = getspnam(ses.authstate.pw->pw_name);
+	spasswd = getspnam(ses.authstate.printableuser);
 	if (spasswd != NULL && spasswd->sp_pwdp != NULL) {
 		passwdcrypt = spasswd->sp_pwdp;
 	}