]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
pwconv and grpconv: don't skip entries makefile
authorSerge Hallyn <shallyn@cisco.com>
Sun, 25 Mar 2018 06:15:33 +0000 (01:15 -0500)
committerSerge Hallyn <shallyn@cisco.com>
Sun, 25 Mar 2018 06:15:33 +0000 (01:15 -0500)
closes #60

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
src/grpconv.c
src/pwconv.c

index f681f07fdcfb40fa6d9890fcc3605b2affc16327..646fb8edb4fc71e171d01e326b09861ce0601d45 100644 (file)
@@ -184,8 +184,10 @@ int main (int argc, char **argv)
         * Remove /etc/gshadow entries for groups not in /etc/group.
         */
        (void) sgr_rewind ();
-       while ((sg = sgr_next ()) != NULL) {
+       sg = sgr_next ();
+       while (sg != NULL) {
                if (gr_locate (sg->sg_name) != NULL) {
+                       sg = sgr_next ();
                        continue;
                }
 
index e2d61f875dc7e1cc9fa4496449f31a89aa7c1323..683909ed582ab3dfbc3d5349c8e0c000eb011ad8 100644 (file)
@@ -223,8 +223,10 @@ int main (int argc, char **argv)
         * Remove /etc/shadow entries for users not in /etc/passwd.
         */
        (void) spw_rewind ();
-       while ((sp = spw_next ()) != NULL) {
+       sp = spw_next ();
+       while (sp != NULL) {
                if (pw_locate (sp->sp_namp) != NULL) {
+                       sp = spw_next ();
                        continue;
                }