1 diff -Nur shadow-4.1.4.2_orig/libmisc/chkname.c shadow-4.1.4.2/libmisc/chkname.c
2 --- shadow-4.1.4.2_orig/libmisc/chkname.c 2009-04-28 19:14:04.000000000 +0000
3 +++ shadow-4.1.4.2/libmisc/chkname.c 2009-08-03 18:47:59.000000000 +0000
5 static bool is_valid_name (const char *name)
8 - * User/group names must match [a-z_][a-z0-9_-]*[$]
10 - if (('\0' == *name) ||
11 - !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) {
12 + * User/group names must match gnu e-regex:
13 + * [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?
15 + * as a non-POSIX, extension, allow "$" as the last char for
16 + * sake of Samba 3.x "add machine script"
18 + if ( ('\0' == *name) ||
19 + !((*name >= 'a' && *name <= 'z') ||
20 + (*name >= 'A' && *name <= 'Z') ||
21 + (*name >= '0' && *name <= '9') ||
22 + (*name == '_') || (*name == '.')
27 while ('\0' != *++name) {
28 - if (!(( ('a' <= *name) && ('z' >= *name) ) ||
29 - ( ('0' <= *name) && ('9' >= *name) ) ||
32 - ( ('$' == *name) && ('\0' == *(name + 1)) )
35 + if (!( (*name >= 'a' && *name <= 'z') ||
36 + (*name >= 'A' && *name <= 'Z') ||
37 + (*name >= '0' && *name <= '9') ||
38 + (*name == '_') || (*name == '.') || (*name == '-') ||
39 + (*name == '$' && *(name + 1) == '\0')
45 diff -Nur shadow-4.1.4.2_orig/man/groupadd.8 shadow-4.1.4.2/man/groupadd.8
46 --- shadow-4.1.4.2_orig/man/groupadd.8 2009-07-24 01:16:24.000000000 +0000
47 +++ shadow-4.1.4.2/man/groupadd.8 2009-08-03 18:51:10.000000000 +0000
52 -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_\-]*[$]?
54 -Groupnames may only be up to characters long\&.
55 +Groupnames may only be up to 32 characters long\&.
57 You may not add a NIS or LDAP group\&. This must be performed on the corresponding server\&.
59 diff -Nur shadow-4.1.4.2_orig/man/useradd.8 shadow-4.1.4.2/man/useradd.8
60 --- shadow-4.1.4.2_orig/man/useradd.8 2009-07-24 01:16:44.000000000 +0000
61 +++ shadow-4.1.4.2/man/useradd.8 2009-08-03 18:51:52.000000000 +0000
64 will deny the user account creation request\&.
66 -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_\-]*[$]?
68 Usernames may only be up to 32 characters long\&.