Package: adduser
Version: 3.110
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch jaunty

It was recently reported to Ubuntu that adduser doesn't support underscores
in usernames.

This appears to be an accidental regression introduced when refactoring the
code out into AdduserCommon.pm, since the last previous mention of
underscores in the changelog is this:

  adduser (3.63) unstable; urgency=low

    * allow underscores again. Bug in the regexp. Thanks to Steve
      Langasek.

   -- Marc Haber <mh+debian-packa...@zugschlus.de>  Thu, 04 Mar 2005 06:38:22 
+0000

Attached is a patch to restore this behavior.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru adduser-3.110ubuntu2/AdduserCommon.pm adduser-3.110ubuntu3/AdduserCommon.pm
--- adduser-3.110ubuntu2/AdduserCommon.pm	2008-11-05 02:22:10.000000000 +0000
+++ adduser-3.110ubuntu3/AdduserCommon.pm	2009-03-19 16:50:23.000000000 +0000
@@ -207,8 +207,8 @@
   $configref->{"dir_mode"} = "0755";
   $configref->{"setgid_home"} = "no";
   $configref->{"no_del_paths"} = "^/$ ^/lost+found/.* ^/media/.* ^/mnt/.* ^/etc/.* ^/bin/.* ^/boot/.* ^/dev/.* ^/lib/.* ^/proc/.* ^/root/.* ^/sbin/.* ^/tmp/.* ^/sys/.* ^/srv/.* ^/opt/.* ^/initrd/.* ^/usr/.* ^/var/.*";
-  $configref->{"name_regex"} = "^[a-z][-a-z0-9]*\$";
-  $configref->{"name_regex_system"} = "^[A-Za-z][-A-Za-z0-9]*\$";
+  $configref->{"name_regex"} = "^[a-z][-a-z0-9_]*\$";
+  $configref->{"name_regex_system"} = "^[A-Za-z][-A-Za-z0-9_]*\$";
   $configref->{"exclude_fstypes"} = "(proc|sysfs|usbfs|devpts|tmpfs)";
   $configref->{"skel_ignore_regex"} = "dpkg-(old|new|dist)\$";
   $configref->{"extra_groups"} = "dialout cdrom floppy audio video plugdev users games";
diff -Nru adduser-3.110ubuntu2/debian/changelog adduser-3.110ubuntu3/debian/changelog
--- adduser-3.110ubuntu2/debian/changelog	2008-12-06 18:28:40.000000000 +0000
+++ adduser-3.110ubuntu3/debian/changelog	2009-03-19 16:51:02.000000000 +0000
@@ -1,3 +1,9 @@
+adduser (3.110ubuntu3) jaunty; urgency=low
+
+  * Fix the default username regexp to allow underscores.  LP: #341698.
+
+ -- Steve Langasek <steve.langa...@ubuntu.com>  Thu, 19 Mar 2009 16:50:59 +0000
+
 adduser (3.110ubuntu2) jaunty; urgency=low
 
   * Fixes for LP: #302870

Reply via email to