From: Serge Hallyn Date: Sun, 25 Mar 2018 06:15:33 +0000 (-0500) Subject: pwconv and grpconv: don't skip entries X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmakefile;p=thirdparty%2Fshadow.git pwconv and grpconv: don't skip entries closes #60 Signed-off-by: Serge Hallyn --- diff --git a/src/grpconv.c b/src/grpconv.c index f681f07fd..646fb8edb 100644 --- a/src/grpconv.c +++ b/src/grpconv.c @@ -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; } diff --git a/src/pwconv.c b/src/pwconv.c index e2d61f875..683909ed5 100644 --- a/src/pwconv.c +++ b/src/pwconv.c @@ -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; }