]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - pw/pwupd.c
Do not expose password if it is empty and PWF_STANDARD format is requested
[pw-darwin.git] / pw / pwupd.c
index 0483be109dae016581519adff4923a3ef721c6ca..84226a90b300b73df246057583e899f485edb68f 100644 (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",