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

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Mon Dec 15 21:54:53 UTC 2008


Author: nekral-guest
Date: 2008-12-15 21:54:53 +0000 (Mon, 15 Dec 2008)
New Revision: 2465

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/NEWS
   upstream/trunk/src/gpasswd.c
Log:
	* NEWS, src/gpasswd.c: Added support usernames with arbitrary
	length.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-11-30 01:32:38 UTC (rev 2464)
+++ upstream/trunk/ChangeLog	2008-12-15 21:54:53 UTC (rev 2465)
@@ -1,3 +1,8 @@
+2008-12-15  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* NEWS, src/gpasswd.c: Added support usernames with arbitrary
+	length.
+
 2008-11-27  Mike Frysinger  <vapier at gentoo.org>
 
 	* configure.in: Fix the "$enable_acct_tools_setuid" = "yes" test.

Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2008-11-30 01:32:38 UTC (rev 2464)
+++ upstream/trunk/NEWS	2008-12-15 21:54:53 UTC (rev 2465)
@@ -32,6 +32,7 @@
   * Added support for long options --add (-a), --delete (-d),
     --remove-password (-r), --restrict (-R), --administrators (-A), and
     --members (-M).
+  * Added support for usernames with arbitrary length.
 - groupadd
   * audit logging improvements.
   * Speedup (see "addition of users or groups" above).

Modified: upstream/trunk/src/gpasswd.c
===================================================================
--- upstream/trunk/src/gpasswd.c	2008-11-30 01:32:38 UTC (rev 2464)
+++ upstream/trunk/src/gpasswd.c	2008-12-15 21:54:53 UTC (rev 2465)
@@ -211,26 +211,17 @@
  */
 static bool is_valid_user_list (const char *users)
 {
-	const char *start, *end;
-	char username[32];
+	const char *username, *end;
 	bool is_valid = true;
-	size_t len;
 
-	for (start = users; (NULL != start) && ('\0' != *start); start = end) {
-		end = strchr (start, ',');
+	for (username = users;
+	     (NULL != username) && ('\0' != *username);
+	     username = end) {
+		end = strchr (username, ',');
 		if (NULL != end) {
-			len = (size_t) (end - start);
 			end++;
-		} else {
-			len = strlen (start);
 		}
 
-		if (len > sizeof (username) - 1) {
-			len = sizeof (username) - 1;
-		}
-		strncpy (username, start, len);
-		username[len] = '\0';
-
 		/*
 		 * This user must exist.
 		 */




More information about the Pkg-shadow-commits mailing list