[Pkg-shadow-commits] r2223 - in upstream/trunk: . src
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Sun Jul 27 22:30:14 UTC 2008
Author: nekral-guest
Date: 2008-07-27 22:30:12 +0000 (Sun, 27 Jul 2008)
New Revision: 2223
Modified:
upstream/trunk/ChangeLog
upstream/trunk/src/groupmems.c
Log:
* src/groupmems.c: Add parenthesis.
* src/groupmems.c: Avoid implicit conversion of pointers / chars to
booleans.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2008-07-27 02:33:37 UTC (rev 2222)
+++ upstream/trunk/ChangeLog 2008-07-27 22:30:12 UTC (rev 2223)
@@ -1,5 +1,11 @@
2008-07-27 Nicolas François <nicolas.francois at centraliens.net>
+ * src/groupmems.c: Add parenthesis.
+ * src/groupmems.c: Avoid implicit conversion of pointers / chars to
+ booleans.
+
+2008-07-27 Nicolas François <nicolas.francois at centraliens.net>
+
* NEWS, src/groupmems.c: Allow everybody to list the users of a group.
This information is publicly available in /etc/group.
* NEWS, src/groupmems.c: Open /etc/group read only for the -l option.
Modified: upstream/trunk/src/groupmems.c
===================================================================
--- upstream/trunk/src/groupmems.c 2008-07-27 02:33:37 UTC (rev 2222)
+++ upstream/trunk/src/groupmems.c 2008-07-27 22:30:12 UTC (rev 2223)
@@ -156,7 +156,7 @@
}
}
- if (exclusive > 1 || optind < argc) {
+ if ((exclusive > 1) || (optind < argc)) {
usage ();
}
@@ -177,25 +177,25 @@
struct passwd *pampw;
pampw = getpwuid (getuid ()); /* local, no need for xgetpwuid */
- if (pampw == NULL) {
+ if (NULL == pampw) {
retval = PAM_USER_UNKNOWN;
}
- if (retval == PAM_SUCCESS) {
+ if (PAM_SUCCESS == retval) {
retval = pam_start ("groupmod", pampw->pw_name,
&conv, &pamh);
}
- if (retval == PAM_SUCCESS) {
+ if (PAM_SUCCESS == retval) {
retval = pam_authenticate (pamh, 0);
}
- if (retval == PAM_SUCCESS) {
+ if (PAM_SUCCESS == retval) {
retval = pam_acct_mgmt (pamh, 0);
}
(void) pam_end (pamh, retval);
- if (retval != PAM_SUCCESS) {
+ if (PAM_SUCCESS != retval) {
fprintf (stderr, _("%s: PAM authentication failed\n"), Prog);
fail_exit (1);
}
@@ -247,7 +247,7 @@
if (!list) {
check_perms ();
- if (!gr_lock ()) {
+ if (gr_lock () == 0) {
fprintf (stderr,
_("%s: unable to lock group file\n"), Prog);
fail_exit (EXIT_GROUP_FILE);
@@ -255,14 +255,14 @@
group_locked = true;
}
- if (!gr_open (list ? O_RDONLY : O_RDWR)) {
+ if (gr_open (list ? O_RDONLY : O_RDWR) == 0) {
fprintf (stderr, _("%s: unable to open group file\n"), Prog);
fail_exit (EXIT_GROUP_FILE);
}
grp = (struct group *) gr_locate (name);
- if (grp == NULL) {
+ if (NULL == grp) {
fprintf (stderr, _("%s: `%s' not found in /etc/group\n"),
Prog, name);
fail_exit (EXIT_INVALID_GROUP);
@@ -293,7 +293,7 @@
gr_update (grp);
}
- if (!gr_close ()) {
+ if (gr_close () == 0) {
fprintf (stderr, _("%s: unable to close group file\n"), Prog);
fail_exit (EXIT_GROUP_FILE);
}
More information about the Pkg-shadow-commits
mailing list