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

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sun Mar 8 20:28:55 UTC 2009


Author: nekral-guest
Date: 2009-03-08 20:28:55 +0000 (Sun, 08 Mar 2009)
New Revision: 2495

Modified:
   upstream/trunk/NEWS
   upstream/trunk/src/grpck.c
   upstream/trunk/src/pwck.c
Log:
	* NEWS, src/grpck.c, src/pwck.c: Issue a warning if an ID is set
	to -1.


Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2009-03-08 20:26:56 UTC (rev 2494)
+++ upstream/trunk/NEWS	2009-03-08 20:28:55 UTC (rev 2495)
@@ -49,6 +49,7 @@
   * audit logging improvements.
   * error handling improvement (see above).
   * Speedup (see "addition of users or groups" above).
+  * do not create groups with GID set to (gid_t)-1.
 - groupdel
   * audit logging improvements.
   * error handling improvement (see above).
@@ -67,13 +68,20 @@
 - groupmod
   * audit logging improvements.
   * error handling improvement (see above).
+  * do not create groups with GID set to (gid_t)-1.
+- grpck
+  * warn for groups with GID set to (gid_t)-1.
 - newusers
   * Implement the -r, --system option.
   * Speedup (see "addition of users or groups" above).
+  * do not create users with UID set to (gid_t)-1.
+  * do not create groups with GID set to (gid_t)-1.
 - passwd
   * For compatibility with other passwd version, the --lock an --unlock
     options do not lock or unlock the user account anymore.  They only
     lock or unlock the user's password.
+- pwck
+  * warn for users with UID set to (uid_t)-1.
 - su
   * 
 - useradd
@@ -81,11 +89,13 @@
   * Speedup (see "addition of users or groups" above).
   * See CREATE_HOME above.
   * New -M/--no-create-home option to disable CREATE_HOME.
+  * do not create users with UID set to (gid_t)-1.
 - userdel
   * audit logging improvements.
 - usermod
   * Allow adding LDAP users (or any user not present in the local passwd
     file) to local groups
+  * do not create users with UID set to (gid_t)-1.
 
 shadow-4.1.2.1 -> shadow-4.1.2.2					23-11-2008
 

Modified: upstream/trunk/src/grpck.c
===================================================================
--- upstream/trunk/src/grpck.c	2009-03-08 20:26:56 UTC (rev 2494)
+++ upstream/trunk/src/grpck.c	2009-03-08 20:28:55 UTC (rev 2495)
@@ -3,7 +3,7 @@
  * Copyright (c) 1996 - 2000, Marek Michałkiewicz
  * Copyright (c) 2001       , Michał Moskal
  * Copyright (c) 2001 - 2006, Tomasz Kłoczko
- * Copyright (c) 2007 - 2008, Nicolas François
+ * Copyright (c) 2007 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -543,6 +543,14 @@
 		}
 
 		/*
+		 * Check for invalid user ID.
+		 */
+		if (grp->gr_gid == (gid_t)-1) {
+			printf (_("invalid user ID '%lu'\n"), grp->gr_gid);
+			*errors += 1;
+		}
+
+		/*
 		 * Workaround for a NYS libc 5.3.12 bug on RedHat 4.2 -
 		 * groups with no members are returned as groups with one
 		 * member "", causing grpck to fail.  --marekm

Modified: upstream/trunk/src/pwck.c
===================================================================
--- upstream/trunk/src/pwck.c	2009-03-08 20:26:56 UTC (rev 2494)
+++ upstream/trunk/src/pwck.c	2009-03-08 20:28:55 UTC (rev 2495)
@@ -3,7 +3,7 @@
  * Copyright (c) 1996 - 2000, Marek Michałkiewicz
  * Copyright (c) 2001       , Michał Moskal
  * Copyright (c) 2001 - 2006, Tomasz Kłoczko
- * Copyright (c) 2007 - 2008, Nicolas François
+ * Copyright (c) 2007 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -396,6 +396,14 @@
 		}
 
 		/*
+		 * Check for invalid user ID.
+		 */
+		if (pwd->pw_uid == (uid_t)-1) {
+			printf (_("invalid user ID '%lu'\n"), pwd->pw_uid);
+			*errors += 1;
+		}
+
+		/*
 		 * Make sure the primary group exists
 		 */
 		/* local, no need for xgetgrgid */




More information about the Pkg-shadow-commits mailing list