diff options
author | fjoe <fjoe@FreeBSD.org> | 2003-01-23 19:51:48 +0000 |
---|---|---|
committer | fjoe <fjoe@FreeBSD.org> | 2003-01-23 19:51:48 +0000 |
commit | b24e1d7b2a81cd82a8673d1c9cf37f002dfe2e34 (patch) | |
tree | e00399cdd5d597709c48b64584ee6c35afa7e3ca /usr.sbin | |
parent | 9d04c4bbe79f773e28c317a24ed595589ac92009 (diff) | |
download | FreeBSD-src-b24e1d7b2a81cd82a8673d1c9cf37f002dfe2e34.zip FreeBSD-src-b24e1d7b2a81cd82a8673d1c9cf37f002dfe2e34.tar.gz |
Do not expose password if it is empty and PWF_STANDARD format is requested
MFC after: 1 week
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pw/pwupd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/pw/pwupd.c b/usr.sbin/pw/pwupd.c index 0483be1..84226a9 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", |