From 30b555b3eadc7f0a3bd775861b0721e21bb914c9 Mon Sep 17 00:00:00 2001 From: fjoe Date: Thu, 23 Jan 2003 19:51:48 +0000 Subject: [PATCH] Do not expose password if it is empty and PWF_STANDARD format is requested MFC after: 1 week --- usr.sbin/pw/pwupd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pw/pwupd.c b/usr.sbin/pw/pwupd.c index 0483be109dae..84226a90b300 100644 --- a/usr.sbin/pw/pwupd.c +++ b/usr.sbin/pw/pwupd.c @@ -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",