]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Remove some code that's no longer needed because it's now part of pw_scan(3).
authorIan Lepore <ian@FreeBSD.org>
Fri, 27 Jul 2018 15:17:24 +0000 (15:17 +0000)
committerIan Lepore <ian@FreeBSD.org>
Fri, 27 Jul 2018 15:17:24 +0000 (15:17 +0000)
It was also leading to segfaults; pw can be NULL when control reaches these
lines now, because of the way my previous change restructured the loops.

Reported by: lwhsu@

pw/pw_vpw.c

index 4517a743c73ea46592746556991ee539878ede14..192d588ab0cf3002e8da3fe225ec8354019a4a10 100644 (file)
@@ -113,18 +113,6 @@ vnextpwent(char const *nam, uid_t uid, int doclose)
        }
        free(line);
 
-       /*
-        * If we read the non-master passwd, some fields may not have been
-        * populated.  Clean them up so that the output looks the same as that
-        * generated using getpwnam() which also inits them to these values.
-        */
-       if (!(pw->pw_fields & _PWF_CLASS))
-               pw->pw_class = "";
-       if (!(pw->pw_fields & _PWF_CHANGE))
-               pw->pw_change = 0;
-       if (!(pw->pw_fields & _PWF_EXPIRE))
-               pw->pw_expire = 0;
-
        return (pw);
 }