[Pkg-shadow-commits] r1622 - in upstream/trunk: . src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Tue Jan 1 23:08:00 UTC 2008


Author: nekral-guest
Date: 2008-01-01 23:07:55 +0000 (Tue, 01 Jan 2008)
New Revision: 1622

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/newgrp.c
Log:
Avoid assignments in conditionals.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-01-01 22:21:55 UTC (rev 1621)
+++ upstream/trunk/ChangeLog	2008-01-01 23:07:55 UTC (rev 1622)
@@ -1,5 +1,9 @@
 2008-01-01  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/newgrp.c: Avoid assignments in conditionals.
+
+2008-01-01  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* lib/shadow.c: Avoid assignments in conditionals.
 
 2008-01-01  Nicolas François  <nicolas.francois at centraliens.net>

Modified: upstream/trunk/src/newgrp.c
===================================================================
--- upstream/trunk/src/newgrp.c	2008-01-01 22:21:55 UTC (rev 1621)
+++ upstream/trunk/src/newgrp.c	2008-01-01 23:07:55 UTC (rev 1622)
@@ -240,7 +240,8 @@
 			 * Perhaps in the past, but the default behavior now depends on the
 			 * group entry, so it had better exist.  -- JWP
 			 */
-			if (!(grp = xgetgrgid (pwd->pw_gid))) {
+			grp = xgetgrgid (pwd->pw_gid);
+			if (NULL == grp) {
 				fprintf (stderr, _("unknown GID: %lu\n"),
 					 (unsigned long) pwd->pw_gid);
 				SYSLOG ((LOG_CRIT, "unknown GID: %lu",
@@ -319,7 +320,8 @@
 	 * including the user's name in the member list of the user's login
 	 * group.  -- JWP
 	 */
-	if (!(grp = getgrnam (group))) { /* local, no need for xgetgrnam */
+	grp = getgrnam (group); /* local, no need for xgetgrnam */
+	if (NULL == grp) {
 		fprintf (stderr, _("unknown group: %s\n"), group);
 		goto failure;
 	}
@@ -341,7 +343,8 @@
 		grp = xgetgrnam (group);
 	}
 #ifdef SHADOWGRP
-	if ((sgrp = getsgnam (group))) {
+	sgrp = getsgnam (group);
+	if (NULL != sgrp) {
 		grp->gr_passwd = sgrp->sg_passwd;
 		grp->gr_mem = sgrp->sg_mem;
 	}
@@ -364,7 +367,8 @@
 	 * password, and the group has a password, she needs to give the
 	 * group password.
 	 */
-	if ((spwd = xgetspnam (name)))
+	spwd = xgetspnam (name);
+	if (NULL != spwd)
 		pwd->pw_passwd = spwd->sp_pwdp;
 
 	if (pwd->pw_passwd[0] == '\0' && grp->gr_passwd[0])
@@ -381,7 +385,8 @@
 		 * get the password from her, and set the salt for
 		 * the decryption from the group file.
 		 */
-		if (!(cp = getpass (_("Password: "))))
+		cp = getpass (_("Password: "));
+		if (NULL == cp)
 			goto failure;
 
 		/*




More information about the Pkg-shadow-commits mailing list