]> granicus.if.org Git - shadow/commitdiff
* NEWS, src/gpasswd.c: Added support usernames with arbitrary
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 15 Dec 2008 21:54:53 +0000 (21:54 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 15 Dec 2008 21:54:53 +0000 (21:54 +0000)
length.

ChangeLog
NEWS
src/gpasswd.c

index c48875ad7a3daf8d7897592da52cad4f79250569..ef673345655ab9a993ec1e7882d9e868d9809878 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-15  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, src/gpasswd.c: Added support usernames with arbitrary
+       length.
+
 2008-11-27  Mike Frysinger  <vapier@gentoo.org>
 
        * configure.in: Fix the "$enable_acct_tools_setuid" = "yes" test.
diff --git a/NEWS b/NEWS
index bbf004cb2bbd4f5e6feb9adb5c80f79fe69ed3de..470d4a0c16c8d9b26c5d848ae3c943992314b5b5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -32,6 +32,7 @@ shadow-4.1.2.2 -> shadow-4.1.3                                                UNRELEASED
   * 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).
index 517008edde3a3be80d28ecba3faf166b239151c8..926e41dc1df0897e9e900e3e492b7de4c6cbf3d6 100644 (file)
@@ -211,25 +211,16 @@ static void fail_exit (int status)
  */
 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.