summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch')
-rw-r--r--meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch51
1 files changed, 31 insertions, 20 deletions
diff --git a/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch b/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
index 1af04d5fe8..cc833362e9 100644
--- a/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
+++ b/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
@@ -1,26 +1,37 @@
1From ca472d6866e545aaa70a70020e3226f236a8aafc Mon Sep 17 00:00:00 2001
2From: Shan Hai <shan.hai@windriver.com>
3Date: Tue, 13 Sep 2016 13:45:46 +0800
4Subject: [PATCH] shadow: use relaxed usernames
1 5
2The groupadd from shadow does not allow upper case group names, the 6The groupadd from shadow does not allow upper case group names, the
3same is true for the upstream shadow. But distributions like 7same is true for the upstream shadow. But distributions like
4Debian/Ubuntu/CentOS has their own way to cope with this problem, 8Debian/Ubuntu/CentOS has their own way to cope with this problem,
5this patch is picked up from CentOS release 7.0 to relax the usernames 9this patch is picked up from CentOS release 7.0 to relax the usernames
6restrictions to allow the upper case group names, and the relaxation is 10restrictions to allow the upper case group names, and the relaxation is
7POSIX compliant because POSIX indicate that usernames are composed of 11POSIX compliant because POSIX indicate that usernames are composed of
8characters from the portable filename character set [A-Za-z0-9._-]. 12characters from the portable filename character set [A-Za-z0-9._-].
9 13
10Upstream-Status: Pending 14Upstream-Status: Pending
11 15
12Signed-off-by: Shan Hai <shan.hai@windriver.com> 16Signed-off-by: Shan Hai <shan.hai@windriver.com>
13 17
14diff -urpN a/libmisc/chkname.c b/libmisc/chkname.c 18---
15index 5089112..f40a0da 100644 19 libmisc/chkname.c | 30 ++++++++++++++++++------------
20 man/groupadd.8.xml | 6 ------
21 man/useradd.8.xml | 8 +-------
22 3 files changed, 19 insertions(+), 25 deletions(-)
23
24diff --git a/libmisc/chkname.c b/libmisc/chkname.c
25index 90f185c..65762b4 100644
16--- a/libmisc/chkname.c 26--- a/libmisc/chkname.c
17+++ b/libmisc/chkname.c 27+++ b/libmisc/chkname.c
18@@ -49,21 +49,28 @@ 28@@ -55,22 +55,28 @@ static bool is_valid_name (const char *name)
19 static bool is_valid_name (const char *name) 29 }
20 { 30
21 /* 31 /*
22- * User/group names must match [a-z_][a-z0-9_-]*[$] 32- * User/group names must match [a-z_][a-z0-9_-]*[$]
23- */ 33- */
34-
24- if (('\0' == *name) || 35- if (('\0' == *name) ||
25- !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) { 36- !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) {
26+ * User/group names must match gnu e-regex: 37+ * User/group names must match gnu e-regex:
@@ -55,28 +66,28 @@ index 5089112..f40a0da 100644
55 return false; 66 return false;
56 } 67 }
57 } 68 }
58diff -urpN a/man/groupadd.8.xml b/man/groupadd.8.xml 69diff --git a/man/groupadd.8.xml b/man/groupadd.8.xml
59index 230fd0c..94f7807 100644 70index 1e58f09..d804b61 100644
60--- a/man/groupadd.8.xml 71--- a/man/groupadd.8.xml
61+++ b/man/groupadd.8.xml 72+++ b/man/groupadd.8.xml
62@@ -222,12 +222,6 @@ 73@@ -272,12 +272,6 @@
74
63 <refsect1 id='caveats'> 75 <refsect1 id='caveats'>
64 <title>CAVEATS</title> 76 <title>CAVEATS</title>
65 <para> 77- <para>
66- Groupnames must start with a lower case letter or an underscore, 78- Groupnames must start with a lower case letter or an underscore,
67- followed by lower case letters, digits, underscores, or dashes. 79- followed by lower case letters, digits, underscores, or dashes.
68- They can end with a dollar sign. 80- They can end with a dollar sign.
69- In regular expression terms: [a-z_][a-z0-9_-]*[$]? 81- In regular expression terms: [a-z_][a-z0-9_-]*[$]?
70- </para> 82- </para>
71- <para> 83 <para>
72 Groupnames may only be up to &GROUP_NAME_MAX_LENGTH; characters long. 84 Groupnames may only be up to &GROUP_NAME_MAX_LENGTH; characters long.
73 </para> 85 </para>
74 <para> 86diff --git a/man/useradd.8.xml b/man/useradd.8.xml
75diff -urpN a/man/useradd.8.xml b/man/useradd.8.xml 87index a16d730..c0bd777 100644
76index 5dec989..fe623b9 100644
77--- a/man/useradd.8.xml 88--- a/man/useradd.8.xml
78+++ b/man/useradd.8.xml 89+++ b/man/useradd.8.xml
79@@ -336,7 +336,7 @@ 90@@ -366,7 +366,7 @@
80 </term> 91 </term>
81 <listitem> 92 <listitem>
82 <para> 93 <para>
@@ -85,16 +96,16 @@ index 5dec989..fe623b9 100644
85 wide setting from <filename>/etc/login.defs</filename> 96 wide setting from <filename>/etc/login.defs</filename>
86 (<option>CREATE_HOME</option>) is set to 97 (<option>CREATE_HOME</option>) is set to
87 <replaceable>yes</replaceable>. 98 <replaceable>yes</replaceable>.
88@@ -607,12 +607,6 @@ 99@@ -660,12 +660,6 @@
100 the user account creation request.
89 </para> 101 </para>
90 102
91 <para> 103- <para>
92- Usernames must start with a lower case letter or an underscore, 104- Usernames must start with a lower case letter or an underscore,
93- followed by lower case letters, digits, underscores, or dashes. 105- followed by lower case letters, digits, underscores, or dashes.
94- They can end with a dollar sign. 106- They can end with a dollar sign.
95- In regular expression terms: [a-z_][a-z0-9_-]*[$]? 107- In regular expression terms: [a-z_][a-z0-9_-]*[$]?
96- </para> 108- </para>
97- <para> 109 <para>
98 Usernames may only be up to 32 characters long. 110 Usernames may only be up to 32 characters long.
99 </para> 111 </para>
100 </refsect1>