summaryrefslogtreecommitdiff
blob: 2d8f0a7cc49fc042633b4f25c57f472782c521fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Allow people to add users with dots in their names.

http://bugs.gentoo.org/show_bug.cgi?id=22920

Index: libmisc/chkname.c
===================================================================
RCS file: /cvsroot/shadow/libmisc/chkname.c,v
retrieving revision 1.8
diff -u -r1.8 chkname.c
--- libmisc/chkname.c	12 May 2003 05:29:14 -0000	1.8
+++ libmisc/chkname.c	10 Jan 2005 06:25:47 -0000
@@ -18,7 +18,7 @@
 static int good_name (const char *name)
 {
 	/*
-	 * User/group names must match [a-z_][a-z0-9_-]*
+	 * User/group names must match [a-z_][a-z0-9_-.$]*
 	 */
 	if (!*name || !((*name >= 'a' && *name <= 'z') || *name == '_'))
 		return 0;
@@ -27,6 +27,7 @@
 		if (!((*name >= 'a' && *name <= 'z') ||
 		      (*name >= '0' && *name <= '9') ||
 		      *name == '_' || *name == '-' ||
+		      *name == '.' ||
 		      (*name == '$' && *(name + 1) == '\0')))
 			return 0;
 	}
Index: man/useradd.8
===================================================================
RCS file: /cvsroot/shadow/man/useradd.8,v
retrieving revision 1.23
diff -u -r1.23 useradd.8
--- man/useradd.8	11 Dec 2004 20:05:01 -0000	1.23
+++ man/useradd.8	10 Jan 2005 06:40:15 -0000
@@ -128,6 +128,23 @@
 .PP
 If no options are specified, \fBuseradd\fR displays the current default
 values.
+.SH RESTRICTS
+Currently,  the  shadow  suite  enforces  the following restrictions on 
+user names:
+
+.nf
+\- must begin with a lower case letter or underscore
+\- can only contain lower case letters, underscores, and dashes
+\- may end with a dollar sign
+\- regex for these requirements: [a\-z_][a\-z0-9_\-$]*
+.fi
+
+The length of usernames is restricted by glibc (via the UT_NAMESIZE define 
+in the utmp header file).  This may range from 8 characters on older 
+systems to 32 characters on newer systems.
+
+Note Gentoo adds a patch which allows people to create usernames with a 
+dot in them.
 .SH NOTES
 The system administrator is responsible for placing the default user files
 in the \fI/etc/skel/\fR directory.