shadow-utils/shadow-4.1.5-goodname.patch

69 lines
2.9 KiB
Diff
Raw Normal View History

2012-03-20 16:39:28 +00:00
diff -up shadow-4.1.5/libmisc/chkname.c.goodname shadow-4.1.5/libmisc/chkname.c
--- shadow-4.1.5/libmisc/chkname.c.goodname 2009-04-28 21:14:04.000000000 +0200
+++ shadow-4.1.5/libmisc/chkname.c 2012-03-19 09:52:12.910605026 +0100
2009-06-16 13:23:28 +00:00
@@ -49,20 +49,28 @@
2009-04-14 10:19:14 +00:00
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) && ('\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;
}
}
2012-03-20 16:39:28 +00:00
diff -up shadow-4.1.5/man/groupadd.8.goodname shadow-4.1.5/man/groupadd.8
--- shadow-4.1.5/man/groupadd.8.goodname 2012-02-12 22:27:42.000000000 +0100
+++ shadow-4.1.5/man/groupadd.8 2012-03-19 09:56:17.113723732 +0100
@@ -181,9 +181,7 @@ Shadow password suite configuration\&.
2009-04-14 10:19:14 +00:00
.RE
.SH "CAVEATS"
.PP
2009-06-16 13:23:28 +00:00
-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_\-]*[$]?
2009-04-14 10:19:14 +00:00
-.PP
2012-03-20 16:39:28 +00:00
-Groupnames may only be up to 16 characters long\&.
2009-04-14 10:19:14 +00:00
+Groupnames may only be up to 32 characters long\&.
.PP
You may not add a NIS or LDAP group\&. This must be performed on the corresponding server\&.
.PP
2012-03-20 16:39:28 +00:00
diff -up shadow-4.1.5/man/useradd.8.goodname shadow-4.1.5/man/useradd.8
--- shadow-4.1.5/man/useradd.8.goodname 2012-02-12 22:28:02.000000000 +0100
+++ shadow-4.1.5/man/useradd.8 2012-03-19 09:52:12.911605018 +0100
@@ -421,8 +421,6 @@ Similarly, if the username already exist
2009-04-14 10:19:14 +00:00
\fBuseradd\fR
will deny the user account creation request\&.
.PP
2009-06-16 13:23:28 +00:00
-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_\-]*[$]?
2009-04-14 10:19:14 +00:00
-.PP
Usernames may only be up to 32 characters long\&.
.SH "CONFIGURATION"
.PP