* 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.
This commit is contained in:
nekral-guest 2008-11-30 01:29:40 +00:00
parent 93358ac3de
commit c28c443d8f
4 changed files with 28 additions and 2 deletions

View File

@ -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

8
NEWS
View File

@ -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

View 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

View 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);
}