]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blob - pkgs/shadow/patches/shadow-4.1.4.3-goodname.patch
kernel: Enable collection of timer information.
[people/arne_f/ipfire-3.x.git] / pkgs / shadow / patches / shadow-4.1.4.3-goodname.patch
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
4 @@ -49,21 +49,29 @@
5 static bool is_valid_name (const char *name)
6 {
7 /*
8 - * User/group names must match [a-z_][a-z0-9_-]*[$]
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_.$-]?
14 + *
15 + * as a non-POSIX, extension, allow "$" as the last char for
16 + * sake of Samba 3.x "add machine script"
17 + */
18 + if ( ('\0' == *name) ||
19 + !((*name >= 'a' && *name <= 'z') ||
20 + (*name >= 'A' && *name <= 'Z') ||
21 + (*name >= '0' && *name <= '9') ||
22 + (*name == '_') || (*name == '.')
23 + )) {
24 return false;
25 }
26
27 while ('\0' != *++name) {
28 - if (!(( ('a' <= *name) && ('z' >= *name) ) ||
29 - ( ('0' <= *name) && ('9' >= *name) ) ||
30 - ('_' == *name) ||
31 - ('-' == *name) ||
32 - ( ('$' == *name) && ('\0' == *(name + 1)) )
33 - )) {
34 - return false;
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')
40 + )) {
41 + return false;
42 }
43 }
44
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
48 @@ -153,9 +153,7 @@
49 .RE
50 .SH "CAVEATS"
51 .PP
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_\-]*[$]?
53 -.PP
54 -Groupnames may only be up to characters long\&.
55 +Groupnames may only be up to 32 characters long\&.
56 .PP
57 You may not add a NIS or LDAP group\&. This must be performed on the corresponding server\&.
58 .PP
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
62 @@ -405,8 +405,6 @@
63 \fBuseradd\fR
64 will deny the user account creation request\&.
65 .PP
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_\-]*[$]?
67 -.PP
68 Usernames may only be up to 32 characters long\&.
69 .SH "CONFIGURATION"
70 .PP