|
|
f556cf9 |
diff -up shadow-4.1.4.1/libmisc/chkname.c.goodname shadow-4.1.4.1/libmisc/chkname.c
|
|
|
f556cf9 |
--- shadow-4.1.4.1/libmisc/chkname.c.goodname 2009-04-28 21:14:04.000000000 +0200
|
|
|
f556cf9 |
+++ shadow-4.1.4.1/libmisc/chkname.c 2009-06-16 13:47:08.000000000 +0200
|
|
|
f556cf9 |
@@ -49,20 +49,28 @@
|
|
|
ea53f7c |
static bool is_valid_name (const char *name)
|
|
|
ea53f7c |
{
|
|
|
ea53f7c |
/*
|
|
|
ea53f7c |
- * User/group names must match [a-z_][a-z0-9_-]*[$]
|
|
|
ea53f7c |
- */
|
|
|
ea53f7c |
- if (('\0' == *name) ||
|
|
|
ea53f7c |
- !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) {
|
|
|
ea53f7c |
+ * User/group names must match gnu e-regex:
|
|
|
ea53f7c |
+ * [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?
|
|
|
ea53f7c |
+ *
|
|
|
ea53f7c |
+ * as a non-POSIX, extension, allow "$" as the last char for
|
|
|
ea53f7c |
+ * sake of Samba 3.x "add machine script"
|
|
|
ea53f7c |
+ */
|
|
|
ea53f7c |
+ if ( ('\0' == *name) ||
|
|
|
ea53f7c |
+ !((*name >= 'a' && *name <= 'z') ||
|
|
|
ea53f7c |
+ (*name >= 'A' && *name <= 'Z') ||
|
|
|
ea53f7c |
+ (*name >= '0' && *name <= '9') ||
|
|
|
ea53f7c |
+ (*name == '_') || (*name == '.')
|
|
|
ea53f7c |
+ )) {
|
|
|
ea53f7c |
return false;
|
|
|
ea53f7c |
}
|
|
|
ea53f7c |
|
|
|
ea53f7c |
while ('\0' != *++name) {
|
|
|
ea53f7c |
- if (!(( ('a' <= *name) && ('z' >= *name) ) ||
|
|
|
ea53f7c |
- ( ('0' <= *name) && ('9' >= *name) ) ||
|
|
|
ea53f7c |
- ('_' == *name) ||
|
|
|
ea53f7c |
- ('-' == *name) ||
|
|
|
ea53f7c |
- ( ('$' == *name) && ('\0' == *(name + 1)) )
|
|
|
ea53f7c |
- )) {
|
|
|
ea53f7c |
+ if (!( (*name >= 'a' && *name <= 'z') ||
|
|
|
ea53f7c |
+ (*name >= 'A' && *name <= 'Z') ||
|
|
|
ea53f7c |
+ (*name >= '0' && *name <= '9') ||
|
|
|
ea53f7c |
+ (*name == '_') || (*name == '.') || (*name == '-') ||
|
|
|
ea53f7c |
+ (*name == '$' && *(name + 1) == '\0')
|
|
|
ea53f7c |
+ )) {
|
|
|
ea53f7c |
return false;
|
|
|
ea53f7c |
}
|
|
|
ea53f7c |
}
|
|
|
f556cf9 |
diff -up shadow-4.1.4.1/man/groupadd.8.goodname shadow-4.1.4.1/man/groupadd.8
|
|
|
f556cf9 |
--- shadow-4.1.4.1/man/groupadd.8.goodname 2009-05-22 15:56:08.000000000 +0200
|
|
|
f556cf9 |
+++ shadow-4.1.4.1/man/groupadd.8 2009-06-16 13:50:41.000000000 +0200
|
|
|
f556cf9 |
@@ -153,9 +153,7 @@ Shadow password suite configuration\&.
|
|
|
ea53f7c |
.RE
|
|
|
ea53f7c |
.SH "CAVEATS"
|
|
|
ea53f7c |
.PP
|
|
|
f556cf9 |
-Groupnames must start with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes\&. They can end with a dollar sign\&. In regular expression terms: [a\-z_][a\-z0\-9_\-]*[$]?
|
|
|
ea53f7c |
-.PP
|
|
|
ea53f7c |
-Groupnames may only be up to 16 characters long\&.
|
|
|
ea53f7c |
+Groupnames may only be up to 32 characters long\&.
|
|
|
ea53f7c |
.PP
|
|
|
ea53f7c |
You may not add a NIS or LDAP group\&. This must be performed on the corresponding server\&.
|
|
|
ea53f7c |
.PP
|
|
|
f556cf9 |
diff -up shadow-4.1.4.1/man/useradd.8.goodname shadow-4.1.4.1/man/useradd.8
|
|
|
f556cf9 |
--- shadow-4.1.4.1/man/useradd.8.goodname 2009-05-22 15:56:28.000000000 +0200
|
|
|
f556cf9 |
+++ shadow-4.1.4.1/man/useradd.8 2009-06-16 13:51:17.000000000 +0200
|
|
|
f556cf9 |
@@ -405,8 +405,6 @@ Similarly, if the username already exist
|
|
|
ea53f7c |
\fBuseradd\fR
|
|
|
ea53f7c |
will deny the user account creation request\&.
|
|
|
ea53f7c |
.PP
|
|
|
f556cf9 |
-Usernames must start with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes\&. They can end with a dollar sign\&. In regular expression terms: [a\-z_][a\-z0\-9_\-]*[$]?
|
|
|
ea53f7c |
-.PP
|
|
|
ea53f7c |
Usernames may only be up to 32 characters long\&.
|
|
|
ea53f7c |
.SH "CONFIGURATION"
|
|
|
ea53f7c |
.PP
|