Chris Staub wrote:
On 10/04/2009 08:25 PM, Dan McGhee wrote:
Hans Kaper wrote:
That the problem arises after the installation of Shadow does not surprise me. After the installation groupadd from LFS-Shadow takes over from Shadow
of your hostsystem.

Yes, I've done more research and discovered that there's no way around it.

A couple Shadow versions ago, there was a patch I think in the CLFS book to fix a few issues - one was to alter useradd and groupadd to reduce the restrictions on user and group names - I've attached the patch here. As I said, this was a couple versions ago so most of the issues in the patch have already been fixed in the latest Shadow version, but the restrictions on user and group names are still there, so the first bit of that patch can still be applied if you want.

It's not really a problem for me since I just use the package name in all lower case (yeah, I use package users too) - my only issue has been the maximum length of user/group names, though in recent Shadow versions that can be changed with a configure switch - I add --without-group-name-max-length to Shadow's configure command.
Thanks, Chris. I made and tested a patch for the current version of shadow. It's attached, if anyone wants to use it.

Dan
Submitted by Dan McGhee
Date: 2009 October 5
Initial package version: 4.1.4.2
Description:  Adds capital letters and '.' to group and user names

--- shadow-4.1.4.2/libmisc/chkname.c.orig	2009-04-28 14:14:04.000000000 -0500
+++ shadow-4.1.4.2/libmisc/chkname.c	2009-10-05 15:35:24.000000000 -0500
@@ -49,17 +49,22 @@
 static bool is_valid_name (const char *name)
 {
 	/*
-	 * User/group names must match [a-z_][a-z0-9_-]*[$]
+	 * User/group names must match [a-zA-Z0-9_.][a-zA-Z0-9_.-]*[$]
 	 */
 	if (('\0' == *name) ||
-	    !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) {
+	    !((('a' <= *name) && ('z' >= *name) ||
+	    ('A' <= *name) && ('Z' >= *name) || 
+	    ('0' <= *name) && ('9'>= *name) ||
+	    ('_' == *name || '.' == *name)))) {
 		return false;
 	}
 
 	while ('\0' != *++name) {
 		if (!(( ('a' <= *name) && ('z' >= *name) ) ||
+		      ( ('A' <= *name) && ('Z' >= *name) ) ||
 		      ( ('0' <= *name) && ('9' >= *name) ) ||
 		      ('_' == *name) ||
+		      ('.' == *name) ||
 		      ('-' == *name) ||
 		      ( ('$' == *name) && ('\0' == *(name + 1)) )
 		     )) {
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to