]> granicus.if.org Git - shadow/commitdiff
* NEWS, configure.in, libmisc/chkname.c: make group max length a
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 30 Nov 2008 01:29:40 +0000 (01:29 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 30 Nov 2008 01:29:40 +0000 (01:29 +0000)
configure option.  The configure behavior encoded is:
<no option> -> default of 16 (like today);
--with-group-name-max-length -> default of 16;
--without-group-name-max-length -> no max length;
--with-group-name-max-length=n > max is set to n.

ChangeLog
NEWS
configure.in
libmisc/chkname.c

index 4669e98556144e9a37d7987a8bb686bab419a4f7..0d95b23c4e099eed3d94d2b95d294c792c1f8ffa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-11-27  Mike Frysinger  <vapier@gentoo.org>
+
+       * NEWS, configure.in, libmisc/chkname.c: make group max length a
+       configure option.  The configure behavior encoded is:
+       <no option> -> default of 16 (like today);
+       --with-group-name-max-length -> default of 16;
+       --without-group-name-max-length -> no max length;
+       --with-group-name-max-length=n > max is set to n.
+
 2008-11-23  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/su.c: (!USE_PAM) Provide visible information indicating that
diff --git a/NEWS b/NEWS
index 7aab4d409f769ef895f9a37b86bd132f29502ef7..bbf004cb2bbd4f5e6feb9adb5c80f79fe69ed3de 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,14 @@ shadow-4.1.2.2 -> shadow-4.1.3                                               UNRELEASED
     groupadd, groupdel, groupmod, newusers, useradd, userdel, and usermod.
     This authentication is not necessary when these tools are not
     installed setuid root.
+  * Added configure --with-group-name-max-length (default) /
+    --without-group-name-max-length options. This permits to configure the maximum length allowed for group names:
+      <no option> -> default of 16 (like today)
+      --with-group-name-max-length -> default of 16
+      --without-group-name-max-length -> no max length
+      --with-group-name-max-length=n > max is set to n
+    No sanity checking is performed on n so people could do
+    something neat like --with-group-name-max-length=MAX_INT
 - addition of users or groups
   * Speed improvement in case UID_MAX/SYS_UID_MAX/GID_MAX/SYS_GID_MAX is
     used for an user/group. This should be noticeable in case of LDAP
index 25ed154665e9fc6300a4873d5d2bf445c186967d..5361b3b8722909584e97908c17890ddd8c0f94e3 100644 (file)
@@ -254,6 +254,16 @@ AC_ARG_WITH(sha-crypt,
 AC_ARG_WITH(nscd,
        [AC_HELP_STRING([--with-nscd], [enable support for nscd @<:@default=yes@:>@])],
        [with_nscd=$withval], [with_nscd=yes])
+AC_ARG_WITH(group-name-max-length,
+       [AC_HELP_STRING([--with-group-name-max-length], [set max group name length @<:@default=16@:>@])],
+       [with_group_name_max_length=$withval], [with_group_name_max_length=yes])
+
+if test "$with_group_name_max_length" = "no" ; then
+       with_group_name_max_length=0
+elif test "$with_group_name_max_length" = "yes" ; then
+       with_group_name_max_length=16
+fi
+AC_DEFINE_UNQUOTED(GROUP_NAME_MAX_LENGTH, $with_group_name_max_length, [max group name length])
 
 AM_CONDITIONAL(USE_SHA_CRYPT, test "x$with_sha_crypt" = "xyes")
 if test "$with_sha_crypt" = "yes"; then
index 2bdc06b64c7b1e6f9856da186f42cec5b2eef519..1ae6a3d76df38b20ce21555328e02df6aaf44d17 100644 (file)
@@ -100,9 +100,8 @@ bool is_valid_group_name (const char *name)
         * Arbitrary limit for group names - max 16
         * characters (same as on HP-UX 10).
         */
-       if (strlen (name) > 16) {
+       if (GROUP_NAME_MAX_LENGTH && strlen (name) > GROUP_NAME_MAX_LENGTH)
                return false;
-       }
 
        return is_valid_name (name);
 }