[Pkg-shadow-commits] r1202 - in trunk/debian: . patches

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Mon Jun 18 21:15:06 UTC 2007


Author: nekral-guest
Date: 2007-06-18 21:15:06 +0000 (Mon, 18 Jun 2007)
New Revision: 1202

Modified:
   trunk/debian/changelog
   trunk/debian/patches/506_relaxed_usernames
Log:
do not allow spaces in usernames. This was at least broken with username
starting with a space or tabulation (the user can be added but not removed).
Closes: #400683


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-06-18 18:24:34 UTC (rev 1201)
+++ trunk/debian/changelog	2007-06-18 21:15:06 UTC (rev 1202)
@@ -9,6 +9,10 @@
     - 201_fix_man_su_fr: fix translation error in french translation for su(1)
     - 202_it_man_uses_gettext: switch italian manpages to gettext. This will
       fix missing paragraphs in translated manpages. Closes: #425689
+  * Debian packaging fixes:
+    - 506_relaxed_usernames: do not allow spaces in usernames. This was at
+      least broken with username starting with a space or tabulation (the user
+      can be added but not removed). Closes: #400683
 
  -- Christian Perrier <bubulle at debian.org>  Sun, 17 Jun 2007 07:38:14 +0200
 

Modified: trunk/debian/patches/506_relaxed_usernames
===================================================================
--- trunk/debian/patches/506_relaxed_usernames	2007-06-18 18:24:34 UTC (rev 1201)
+++ trunk/debian/patches/506_relaxed_usernames	2007-06-18 21:15:06 UTC (rev 1202)
@@ -17,8 +17,8 @@
 
 Index: shadow-4.0.18.1/libmisc/chkname.c
 ===================================================================
---- shadow-4.0.18.1.orig/libmisc/chkname.c	2005-08-31 19:24:57.000000000 +0200
-+++ shadow-4.0.18.1/libmisc/chkname.c	2006-09-17 12:17:59.836052044 +0200
+--- shadow-4.0.18.1.orig/libmisc/chkname.c	2005-08-31 18:24:57.000000000 +0100
++++ shadow-4.0.18.1/libmisc/chkname.c	2007-06-18 22:06:29.000000000 +0100
 @@ -17,6 +17,7 @@
  #endif
  static int good_name (const char *name)
@@ -27,18 +27,22 @@
  	/*
  	 * User/group names must match [a-z_][a-z0-9_-]*[$]
  	 */
-@@ -30,6 +31,16 @@
+@@ -30,6 +31,20 @@
  		      (*name == '$' && *(name + 1) == '\0')))
  			return 0;
  	}
 +#endif
 +	/*
-+	 * Allow more relaxed user/group names in Debian -- ^[^-:\n][^:\n]*$
++     * POSIX indicate that usernames are composed of characters from the
++     * portable filename character set [A-Za-z0-9._-], and that the hyphen
++     * should not be used as the first character of a portable user name.
++     *
++	 * Allow more relaxed user/group names in Debian -- ^[^-:\s][^:\s]*$
 +	 */
-+	if (!*name || *name == '-')
++	if (!*name || isspace(*name))
 +		return 0;
 +	do
-+		if (*name == ':' || *name == '\n')
++		if (*name == ':' || isspace(*name))
 +			return 0;
 +	while (*++name);
  
@@ -46,8 +50,8 @@
  }
 Index: shadow-4.0.18.1/man/useradd.8.xml
 ===================================================================
---- shadow-4.0.18.1.orig/man/useradd.8.xml	2006-07-24 07:48:36.000000000 +0200
-+++ shadow-4.0.18.1/man/useradd.8.xml	2006-09-17 12:17:59.836052044 +0200
+--- shadow-4.0.18.1.orig/man/useradd.8.xml	2006-07-24 06:48:36.000000000 +0100
++++ shadow-4.0.18.1/man/useradd.8.xml	2007-06-18 22:10:15.000000000 +0100
 @@ -172,6 +172,7 @@
  	    valid in conjunction with the <option>-m</option> option. The
  	    default is to not create the directory and to not copy any
@@ -67,9 +71,9 @@
 +      a lower case letter or an underscore, and are only followed by lower
 +      case letters, digits, underscores, dashes, and optionally terminated by
 +      a dollar sign. In regular expression terms: [a-z_][a-z0-9_-]*[$]?
-+      On Debian, the only constraints are that usernames must neither start with a
-+      dash ('-') nor contain a colon (':')
-+      or an end of line ('\n').
++      On Debian, the only constraints are that usernames must neither start
++      with a dash ('-') nor contain a colon (':') or a whitespace (space:' ',
++      end of line: '\n', tabulation: '\t', etc.).
      </para>
    </refsect1>
  




More information about the Pkg-shadow-commits mailing list