]> TLD Linux GIT Repositories - packages/shadow.git/blob - shadow-goodname.patch
- merged uidmap subpackage and files fixes from PLD
[packages/shadow.git] / shadow-goodname.patch
1 diff -urpa shadow-4.8.orig/libmisc/chkname.c shadow-4.8/libmisc/chkname.c
2 --- shadow-4.8.orig/libmisc/chkname.c   2019-10-05 03:23:58.000000000 +0200
3 +++ shadow-4.8/libmisc/chkname.c        2019-12-15 23:50:06.137000000 +0100
4 @@ -55,21 +55,28 @@ static bool is_valid_name (const char *n
5         }
6  
7         /*
8 -        * User/group names must match [a-z_][a-z0-9_-]*[$]
9 +        * User/group names must match gnu e-regex:
10 +        *    [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?
11 +        *
12 +        * as a non-POSIX, extension, allow "$" as the last char for
13 +        * sake of Samba 3.x "add machine script"
14          */
15 -
16 -       if (('\0' == *name) ||
17 -           !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) {
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 +               if (!(  (*name >= 'a' && *name <= 'z') ||
35 +                       (*name >= 'A' && *name <= 'Z') ||
36 +                       (*name >= '0' && *name <= '9') ||
37 +                       (*name == '_') || (*name == '.') || (*name == '-') ||
38 +                       (*name == '$' && *(name + 1) == '\0')
39 +               )) {
40                         return false;
41                 }
42         }
43 diff -urpa shadow-4.8.orig/man/groupadd.8.xml shadow-4.8/man/groupadd.8.xml
44 --- shadow-4.8.orig/man/groupadd.8.xml  2019-07-23 17:26:08.000000000 +0200
45 +++ shadow-4.8/man/groupadd.8.xml       2019-12-15 23:41:44.562000000 +0100
46 @@ -273,12 +273,6 @@
47     <refsect1 id='caveats'>
48       <title>CAVEATS</title>
49       <para>
50 -       Groupnames must start with a lower case letter or an underscore,
51 -       followed by lower case letters, digits, underscores, or dashes.
52 -       They can end with a dollar sign.
53 -       In regular expression terms: [a-z_][a-z0-9_-]*[$]?
54 -     </para>
55 -     <para>
56         Groupnames may only be up to &GROUP_NAME_MAX_LENGTH; characters long.
57       </para>
58       <para>
59 diff -urpa shadow-4.8.orig/man/man8/groupadd.8 shadow-4.8/man/man8/groupadd.8
60 --- shadow-4.8.orig/man/man8/groupadd.8 2019-12-01 18:45:34.000000000 +0100
61 +++ shadow-4.8/man/man8/groupadd.8      2019-12-15 23:41:44.563000000 +0100
62 @@ -197,9 +197,7 @@ Shadow password suite configuration\&.
63  .RE
64  .SH "CAVEATS"
65  .PP
66 -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_\-]*[$]?
67 -.PP
68 -Groupnames may only be up to 16 characters long\&.
69 +Groupnames may only be up to 32 characters long\&.
70  .PP
71  You may not add a NIS or LDAP group\&. This must be performed on the corresponding server\&.
72  .PP
73 diff -urpa shadow-4.8.orig/man/man8/useradd.8 shadow-4.8/man/man8/useradd.8
74 --- shadow-4.8.orig/man/man8/useradd.8  2019-12-01 18:45:38.000000000 +0100
75 +++ shadow-4.8/man/man8/useradd.8       2019-12-15 23:41:44.563000000 +0100
76 @@ -226,7 +226,7 @@ is not enabled, no home directories are
77  .PP
78  \fB\-M\fR, \fB\-\-no\-create\-home\fR
79  .RS 4
80 -Do no create the user\*(Aqs home directory, even if the system wide setting from
81 +Do not create the user\*(Aqs home directory, even if the system wide setting from
82  /etc/login\&.defs
83  (\fBCREATE_HOME\fR) is set to
84  \fIyes\fR\&.
85 @@ -440,8 +440,6 @@ Similarly, if the username already exist
86  \fBuseradd\fR
87  will deny the user account creation request\&.
88  .PP
89 -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_\-]*[$]?
90 -.PP
91  Usernames may only be up to 32 characters long\&.
92  .SH "CONFIGURATION"
93  .PP
94 diff -urpa shadow-4.8.orig/man/useradd.8.xml shadow-4.8/man/useradd.8.xml
95 --- shadow-4.8.orig/man/useradd.8.xml   2019-10-05 03:23:58.000000000 +0200
96 +++ shadow-4.8/man/useradd.8.xml        2019-12-15 23:41:44.563000000 +0100
97 @@ -366,7 +366,7 @@
98         </term>
99         <listitem>
100           <para>
101 -           Do no create the user's home directory, even if the system
102 +           Do not create the user's home directory, even if the system
103             wide setting from <filename>/etc/login.defs</filename>
104             (<option>CREATE_HOME</option>) is set to
105             <replaceable>yes</replaceable>.
106 @@ -661,12 +661,6 @@
107      </para>
108  
109      <para>
110 -      Usernames must start with a lower case letter or an underscore,
111 -      followed by lower case letters, digits, underscores, or dashes.
112 -      They can end with a dollar sign.
113 -      In regular expression terms: [a-z_][a-z0-9_-]*[$]?
114 -    </para>
115 -    <para>
116        Usernames may only be up to 32 characters long.
117      </para>
118    </refsect1>