summaryrefslogtreecommitdiffstats
path: root/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 10:05:37 -0700
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-22 21:26:31 -0400
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadtalos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz
talos-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch')
-rw-r--r--poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch b/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
new file mode 100644
index 000000000..1af04d5fe
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
@@ -0,0 +1,100 @@
+
+The groupadd from shadow does not allow upper case group names, the
+same is true for the upstream shadow. But distributions like
+Debian/Ubuntu/CentOS has their own way to cope with this problem,
+this patch is picked up from CentOS release 7.0 to relax the usernames
+restrictions to allow the upper case group names, and the relaxation is
+POSIX compliant because POSIX indicate that usernames are composed of
+characters from the portable filename character set [A-Za-z0-9._-].
+
+Upstream-Status: Pending
+
+Signed-off-by: Shan Hai <shan.hai@windriver.com>
+
+diff -urpN a/libmisc/chkname.c b/libmisc/chkname.c
+index 5089112..f40a0da 100644
+--- a/libmisc/chkname.c
++++ b/libmisc/chkname.c
+@@ -49,21 +49,28 @@
+ static bool is_valid_name (const char *name)
+ {
+ /*
+- * User/group names must match [a-z_][a-z0-9_-]*[$]
+- */
+- if (('\0' == *name) ||
+- !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) {
++ * User/group names must match gnu e-regex:
++ * [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?
++ *
++ * as a non-POSIX, extension, allow "$" as the last char for
++ * sake of Samba 3.x "add machine script"
++ */
++ if ( ('\0' == *name) ||
++ !((*name >= 'a' && *name <= 'z') ||
++ (*name >= 'A' && *name <= 'Z') ||
++ (*name >= '0' && *name <= '9') ||
++ (*name == '_') || (*name == '.')
++ )) {
+ return false;
+ }
+
+ while ('\0' != *++name) {
+- if (!(( ('a' <= *name) && ('z' >= *name) ) ||
+- ( ('0' <= *name) && ('9' >= *name) ) ||
+- ('_' == *name) ||
+- ('-' == *name) ||
+- ('.' == *name) ||
+- ( ('$' == *name) && ('\0' == *(name + 1)) )
+- )) {
++ if (!( (*name >= 'a' && *name <= 'z') ||
++ (*name >= 'A' && *name <= 'Z') ||
++ (*name >= '0' && *name <= '9') ||
++ (*name == '_') || (*name == '.') || (*name == '-') ||
++ (*name == '$' && *(name + 1) == '\0')
++ )) {
+ return false;
+ }
+ }
+diff -urpN a/man/groupadd.8.xml b/man/groupadd.8.xml
+index 230fd0c..94f7807 100644
+--- a/man/groupadd.8.xml
++++ b/man/groupadd.8.xml
+@@ -222,12 +222,6 @@
+ <refsect1 id='caveats'>
+ <title>CAVEATS</title>
+ <para>
+- 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_-]*[$]?
+- </para>
+- <para>
+ Groupnames may only be up to &GROUP_NAME_MAX_LENGTH; characters long.
+ </para>
+ <para>
+diff -urpN a/man/useradd.8.xml b/man/useradd.8.xml
+index 5dec989..fe623b9 100644
+--- a/man/useradd.8.xml
++++ b/man/useradd.8.xml
+@@ -336,7 +336,7 @@
+ </term>
+ <listitem>
+ <para>
+- Do no create the user's home directory, even if the system
++ Do not create the user's home directory, even if the system
+ wide setting from <filename>/etc/login.defs</filename>
+ (<option>CREATE_HOME</option>) is set to
+ <replaceable>yes</replaceable>.
+@@ -607,12 +607,6 @@
+ </para>
+
+ <para>
+- 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_-]*[$]?
+- </para>
+- <para>
+ Usernames may only be up to 32 characters long.
+ </para>
+ </refsect1>
OpenPOWER on IntegriCloud