[Pkg-shadow-commits] r1608 - in upstream/trunk: . src
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Tue Jan 1 16:54:19 UTC 2008
Author: nekral-guest
Date: 2008-01-01 16:54:18 +0000 (Tue, 01 Jan 2008)
New Revision: 1608
Modified:
upstream/trunk/ChangeLog
upstream/trunk/src/grpck.c
Log:
Avoid implicit brackets.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2008-01-01 16:40:50 UTC (rev 1607)
+++ upstream/trunk/ChangeLog 2008-01-01 16:54:18 UTC (rev 1608)
@@ -1,5 +1,9 @@
2008-01-01 Nicolas François <nicolas.francois at centraliens.net>
+ * src/grpck.c: Avoid implicit brackets.
+
+2008-01-01 Nicolas François <nicolas.francois at centraliens.net>
+
* NEWS: No functional changes were introduced by the previous pwck
and grpck changes, except for the following bug fix: no syslog
logging if a passwd or group file was specified on the command
Modified: upstream/trunk/src/grpck.c
===================================================================
--- upstream/trunk/src/grpck.c 2008-01-01 16:40:50 UTC (rev 1607)
+++ upstream/trunk/src/grpck.c 2008-01-01 16:54:18 UTC (rev 1608)
@@ -119,13 +119,17 @@
{
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];
+ }
+ }
}
/*
@@ -327,8 +331,9 @@
*/
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.
@@ -337,8 +342,9 @@
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;
@@ -368,8 +374,9 @@
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
@@ -398,8 +405,9 @@
* 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
@@ -419,8 +427,9 @@
/*
* 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
@@ -452,17 +461,20 @@
/*
* 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
@@ -475,8 +487,9 @@
/*
* prompt the user to delete the entry or not
*/
- if (yes_or_no (read_only))
+ if (yes_or_no (read_only)) {
goto delete_gr;
+ }
}
/*
@@ -493,8 +506,9 @@
* 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"),
@@ -600,8 +614,9 @@
/*
* 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.
@@ -633,17 +648,20 @@
/*
* 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
@@ -656,8 +674,9 @@
/*
* prompt the user to delete the entry or not
*/
- if (yes_or_no (read_only))
+ if (yes_or_no (read_only)) {
goto delete_sg;
+ }
}
/*
@@ -669,8 +688,9 @@
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
@@ -737,8 +757,9 @@
if (sort_mode) {
gr_sort ();
#ifdef SHADOWGRP
- if (is_shadow)
+ if (is_shadow) {
sgr_sort ();
+ }
changed = 1;
#endif
} else {
@@ -758,10 +779,12 @@
/*
* 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);
}
+
More information about the Pkg-shadow-commits
mailing list