Do not expose password if it is empty and PWF_STANDARD format is requested

MFC after:	1 week
This commit is contained in:
Max Khon 2003-01-23 19:51:48 +00:00
parent 77e48fe336
commit 41a1582349
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109749

View File

@ -111,7 +111,8 @@ fmtpwentry(char *buf, struct passwd * pwd, int type)
int l;
char *pw;
pw = (pwd->pw_passwd == NULL || !*pwd->pw_passwd) ? "" : (type == PWF_MASTER) ? pwd->pw_passwd : "*";
pw = (type == PWF_MASTER) ?
((pwd->pw_passwd == NULL) ? "" : pwd->pw_passwd) : "*";
if (type == PWF_PASSWD)
l = sprintf(buf, "%s:*:%ld:%ld:%s:%s:%s\n",