[Pkg-shadow-commits] r1532 - upstream/trunk/src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Fri Dec 28 19:08:33 UTC 2007


Author: nekral-guest
Date: 2007-12-28 19:08:33 +0000 (Fri, 28 Dec 2007)
New Revision: 1532

Modified:
   upstream/trunk/src/groupadd.c
Log:
I forgot the initialization of group_id in find_new_gid().


Modified: upstream/trunk/src/groupadd.c
===================================================================
--- upstream/trunk/src/groupadd.c	2007-12-28 11:22:27 UTC (rev 1531)
+++ upstream/trunk/src/groupadd.c	2007-12-28 19:08:33 UTC (rev 1532)
@@ -209,6 +209,11 @@
 	gid_max = getdef_unum ("GID_MAX", 60000);
 
 	/*
+	 * Start with the lowest GID.
+	 */
+	group_id = gid_min;
+
+	/*
 	 * Search the entire group file, looking for the largest unused
 	 * value.
 	 */
@@ -404,7 +409,7 @@
 			 * note: -K GID_MIN=10,GID_MAX=499 doesn't work yet
 			 */
 			cp = strchr (optarg, '=');
-			if (!cp) {
+			if (NULL == cp) {
 				fprintf (stderr,
 					 _
 					 ("%s: -K requires KEY=VALUE\n"),
@@ -444,7 +449,7 @@
 	 * Check if the group already exist.
 	 */
 	/* local, no need for xgetgrnam */
-	if (getgrnam (group_name)) {
+	if (getgrnam (group_name) != NULL) {
 		/* The group already exist */
 		if (fflg) {
 			/* OK, no need to do anything */




More information about the Pkg-shadow-commits mailing list