{
int i;
- for (i = 0; list[i]; i++)
- if (list[i] == member)
+ for (i = 0; list[i]; i++) {
+ if (list[i] == member) {
break;
+ }
+ }
- if (list[i])
- for (; list[i]; i++)
+ if (list[i]) {
+ for (; list[i]; i++) {
list[i] = list[i + 1];
+ }
+ }
}
/*
*/
for (i = 0; members[i]; i++) {
/* local, no need for xgetpwnam */
- if (getpwnam (members[i]))
+ if (getpwnam (members[i])) {
continue;
+ }
/*
* Can't find this user. Remove them
* from the list.
printf (fmt_info, groupname, members[i]);
printf (fmt_prompt, members[i]);
- if (!yes_or_no (read_only))
+ if (!yes_or_no (read_only)) {
continue;
+ }
SYSLOG ((LOG_INFO, fmt_syslog, members[i], groupname));
members_changed = 1;
for (pmem = members; *pmem; pmem++) {
for (other_pmem = other_members; *other_pmem; other_pmem++) {
- if (strcmp (*pmem, *other_pmem) == 0)
+ if (strcmp (*pmem, *other_pmem) == 0) {
break;
+ }
}
if (*other_pmem == NULL) {
printf
* Skip all NIS entries.
*/
- if (gre->line[0] == '+' || gre->line[0] == '-')
+ if ((gre->line[0] == '+') || (gre->line[0] == '-')) {
continue;
+ }
/*
* Start with the entries that are completely corrupt. They
/*
* prompt the user to delete the entry or not
*/
- if (!yes_or_no (read_only))
+ if (!yes_or_no (read_only)) {
continue;
+ }
/*
* All group file deletions wind up here. This code
/*
* Don't check this entry
*/
- if (tgre == gre)
+ if (tgre == gre) {
continue;
+ }
/*
* Don't check invalid entries.
*/
- if (!ent)
+ if (!ent) {
continue;
+ }
- if (strcmp (grp->gr_name, ent->gr_name) != 0)
+ if (strcmp (grp->gr_name, ent->gr_name) != 0) {
continue;
+ }
/*
* Tell the user this entry is a duplicate of
/*
* prompt the user to delete the entry or not
*/
- if (yes_or_no (read_only))
+ if (yes_or_no (read_only)) {
goto delete_gr;
+ }
}
/*
* member "", causing grpck to fail. --marekm
*/
if (grp->gr_mem[0] && !grp->gr_mem[1]
- && *(grp->gr_mem[0]) == '\0')
+ && *(grp->gr_mem[0]) == '\0') {
grp->gr_mem[0] = (char *) 0;
+ }
if (check_members (grp->gr_name, grp->gr_mem,
_("group %s: no user %s\n"),
/*
* prompt the user to delete the entry or not
*/
- if (!yes_or_no (read_only))
+ if (!yes_or_no (read_only)) {
continue;
+ }
/*
* All shadow group file deletions wind up here.
/*
* Don't check this entry
*/
- if (tsge == sge)
+ if (tsge == sge) {
continue;
+ }
/*
* Don't check invalid entries.
*/
- if (!ent)
+ if (!ent) {
continue;
+ }
- if (strcmp (sgr->sg_name, ent->sg_name) != 0)
+ if (strcmp (sgr->sg_name, ent->sg_name) != 0) {
continue;
+ }
/*
* Tell the user this entry is a duplicate of
/*
* prompt the user to delete the entry or not
*/
- if (yes_or_no (read_only))
+ if (yes_or_no (read_only)) {
goto delete_sg;
+ }
}
/*
grp_file);
printf (_("delete line '%s'? "), sge->line);
*errors += 1;
- if (yes_or_no (read_only))
+ if (yes_or_no (read_only)) {
goto delete_sg;
+ }
} else {
/**
* Verify that the all members defined in /etc/gshadow are also
if (sort_mode) {
gr_sort ();
#ifdef SHADOWGRP
- if (is_shadow)
+ if (is_shadow) {
sgr_sort ();
+ }
changed = 1;
#endif
} else {
/*
* Tell the user what we did and exit.
*/
- if (errors)
+ if (errors) {
printf (changed ?
_("%s: the files have been updated\n") :
_("%s: no changes\n"), Prog);
+ }
exit (errors ? E_BAD_ENTRY : E_OKAY);
}
+