upstream commit

avoid modifying pw->pw_passwd; let endpwent() clean up
for us, but keep a scrubbed copy; bz2777, ok dtucker@

OpenBSD-Commit-ID: 715afc0f59c6b82c4929a73279199ed241ce0752
This commit is contained in:
djm@openbsd.org 2018-01-23 05:01:15 +00:00 committed by Damien Miller
parent a69bbb07cd
commit d6364f6fb1
1 changed files with 2 additions and 4 deletions

6
sshd.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: sshd.c,v 1.499 2017/11/14 00:45:29 djm Exp $ */
/* $OpenBSD: sshd.c,v 1.500 2018/01/23 05:01:15 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -1695,10 +1695,8 @@ main(int ac, char **av)
fatal("Privilege separation user %s does not exist",
SSH_PRIVSEP_USER);
} else {
explicit_bzero(privsep_pw->pw_passwd,
strlen(privsep_pw->pw_passwd));
privsep_pw = pwcopy(privsep_pw);
free(privsep_pw->pw_passwd);
freezero(privsep_pw->pw_passwd, strlen(privsep_pw->pw_passwd));
privsep_pw->pw_passwd = xstrdup("*");
}
endpwent();