* src/grpck.c (check_members): When a member is removed, do not

increase the index.
	* src/grpck.c: Fix typo in messages and comments.
This commit is contained in:
nekral-guest 2009-03-21 19:42:48 +00:00
parent dab1523df5
commit 503976fc6a
2 changed files with 14 additions and 3 deletions

View File

@ -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

View 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)) {