]> granicus.if.org Git - shadow/commitdiff
* src/grpck.c (check_members): When a member is removed, do not
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 21 Mar 2009 19:42:48 +0000 (19:42 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 21 Mar 2009 19:42:48 +0000 (19:42 +0000)
increase the index.
* src/grpck.c: Fix typo in messages and comments.

ChangeLog
src/grpck.c

index 5a7e54a4a41f2644caa10f2bce9c74ea0d26086b..e5f9a22f7dc773816c665c8d400ed6d4972cb85a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-21  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/grpck.c (check_members): When a member is removed, do not
+       increase the index.
+       * src/grpck.c: Fix typo in messages and comments.
+
 2009-03-21  Nicolas François  <nicolas.francois@centraliens.net>
 
        * lib/commonio.c: Call fsync before closing the backup file. This
index e89cbfdd5e03b53e1987324e3d45f7c8a886c180..6b3193c2cdb0d03ea7d543edb57b31fa12800bbe 100644 (file)
@@ -146,6 +146,8 @@ static void usage (void)
 
 /*
  * delete_member - delete an entry in a list of members
+ *
+ * It only deletes the first entry with the given name.
  */
 static void delete_member (char **list, const char *member)
 {
@@ -389,6 +391,9 @@ static int check_members (const char *groupname,
                SYSLOG ((LOG_INFO, fmt_syslog, members[i], groupname));
                members_changed = 1;
                delete_member (members, members[i]);
+
+               /* Rewind in case of removal */
+               i--;
        }
 
        return members_changed;
@@ -543,10 +548,10 @@ static void check_grp_file (int *errors, bool *changed)
                }
 
                /*
-                * Check for invalid user ID.
+                * Check for invalid group ID.
                 */
                if (grp->gr_gid == (gid_t)-1) {
-                       printf (_("invalid user ID '%lu'\n"), (long unsigned int)grp->gr_gid);
+                       printf (_("invalid group ID '%lu'\n"), (long unsigned int)grp->gr_gid);
                        *errors += 1;
                }
 
@@ -582,7 +587,7 @@ static void check_grp_file (int *errors, bool *changed)
                                printf (_
                                        ("no matching group file entry in %s\n"),
                                        sgr_file);
-                               printf (_("add group '%s' in %s ?"),
+                               printf (_("add group '%s' in %s?"),
                                        grp->gr_name, sgr_file);
                                *errors += 1;
                                if (yes_or_no (read_only)) {