Milan Bouchet-Valat
2010-Nov-21 11:54 UTC
Bug#604242: [patch] Allow dots in username by default
Package: adduser Version: 3.112 I don''t think there''s a reason not to allow usernames to contain dots (.), as they are also allowed to contain underscores (_) and dashes (-). useradd accepts this. Attached is a patch that makes dots be allowed just as other special chars. One could also add the point in this line in /etc/adduser.conf: #NAME_REGEX="^[a-z][-a-z0-9_]*\$" but providing a patch for that makes the change harder to perform! ;-) This fix would be appreciated for the gnome-system-tools, because currently users-admin says dots are accepted, and this is false on Debian. Saying dots are not allowed would be an issue because other platforms allow for them, which means Debian should carry a specific patch... Original report in Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-system-tools/+bug/677929 _______________________________________________ Adduser-devel mailing list Adduser-devel@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/adduser-devel
Stephen Gran
2010-Nov-21 17:42 UTC
[Adduser-devel] Bug#604242: Bug#604242: [patch] Allow dots in username by default
This one time, at band camp, Milan Bouchet-Valat said:> I don''t think there''s a reason not to allow usernames to contain dots > (.), as they are also allowed to contain underscores (_) and dashes (-). > useradd accepts this. > > Attached is a patch that makes dots be allowed just as other special > chars. One could also add the point in this line in /etc/adduser.conf: > #NAME_REGEX="^[a-z][-a-z0-9_]*\$" > but providing a patch for that makes the change harder to perform! ;-) > > > This fix would be appreciated for the gnome-system-tools, because > currently users-admin says dots are accepted, and this is false on > Debian. Saying dots are not allowed would be an issue because other > platforms allow for them, which means Debian should carry a specific > patch...- $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_.]*\$"; That''s a regex, so a bare . is almost certainly not what you want there. Why does users-admin use adduser instead of useradd? It''s not that it shouldn''t, but adduser is primarily designed as a policy compliant method for maintainers to interface in a policy compliant way with user management in maintainer scripts - extending it to be a general purpose user management script for all manner of environments isn''t what it''s aimed at, and I''m not convinced it will be a good thing to make it general purpose. I think before changing the naming policy of adduser, it does make sense to stop for a moment and check if you''re using the right tool for the job. Cheers, -- ----------------------------------------------------------------- | ,''''`. Stephen Gran | | : :'' : sgran at debian.org | | `. `'' Debian user, admin, and developer | | `- http://www.debian.org | ----------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.alioth.debian.org/pipermail/adduser-devel/attachments/20101121/5ab686eb/attachment.pgp>
Milan Bouchet-Valat
2010-Nov-21 18:14 UTC
[Adduser-devel] Bug#604242: Bug#604242: [patch] Allow dots in username by default
Le dimanche 21 novembre 2010 ? 17:42 +0000, Stephen Gran a ?crit :> - $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_.]*\$"; > > That''s a regex, so a bare . is almost certainly not what you want there.Indeed, kind of silly. Of course, we need to escape it...> Why does users-admin use adduser instead of useradd? It''s not that > it shouldn''t, but adduser is primarily designed as a policy compliant > method for maintainers to interface in a policy compliant way with user > management in maintainer scripts - extending it to be a general purpose > user management script for all manner of environments isn''t what it''s > aimed at, and I''m not convinced it will be a good thing to make it > general purpose. I think before changing the naming policy of adduser, > it does make sense to stop for a moment and check if you''re using the > right tool for the job.AFAIK, users-admin has always used adduser on Debian systems, I guess with the idea that it will more likely to what the admin wants, since settings from /etc/adduser.conf will be used. But this also brings many issues, because we can never be sure what adduser is going to do, nor if it will fail (the present bug being a good example). Anyway, users-admin is being replaced with accounts-dialog in GNOME, so I''m not going to change the way it works. And accounts-dialog uses useradd (it was mainly designed for Fedora originally), and I guess that''s what we''ll want to keep for Debian too, but that creates other problems (like: how do you choose where to create home directories? what if people create accounts using adduser once, and accounts-dialog the other?). The current bug should also IMHO be fixed for adduser itself, disregarding the fact that users-admin needs it. I can''t find a reason why dots shouldn''t be allowed, and they can be pretty convenient for some naming conventions (e.g. firstname.lastname)
Marc Haber
2011-Nov-23 10:11 UTC
[Adduser-devel] Bug#604242: Bug#604242: [patch] Allow dots in username by default
severity 604242 wishlist thanks On Sun, Nov 21, 2010 at 07:14:36PM +0100, Milan Bouchet-Valat wrote:> The current bug should also IMHO be fixed for adduser itself, > disregarding the fact that users-admin needs it. I can''t find a reason > why dots shouldn''t be allowed, and they can be pretty convenient for > some naming conventions (e.g. firstname.lastname)Having dots in the user name creates some issues with scipts using chown, which still accepts dots as separator between user name and group name. If chown still accepts dots, there will be scripts using this notation, which will break if a user name contains a dot. I would recommend keeping the current default (which can be overwritten by local configuration) until chown has stopped accepting dots as separator. IMO, chown compatibility and not breaking third-party scripts is more important than being consistent with some graphical front-end''s documentation. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 31958061 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 31958062
Debian Bug Tracking System
2011-Nov-23 10:15 UTC
[Adduser-devel] Processed: Re: Bug#604242: Bug#604242: [patch] Allow dots in username by default
Processing commands for control at bugs.debian.org:> severity 604242 wishlistBug #604242 [adduser] [patch] Allow dots in username by default Severity set to ''wishlist'' from ''normal''> thanksStopping processing here. Please contact me if you need assistance. -- 604242: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=604242 Debian Bug Tracking System Contact owner at bugs.debian.org with problems
Milan Bouchet-Valat
2011-Nov-23 12:06 UTC
[Adduser-devel] Bug#604242: Bug#604242: [patch] Allow dots in username by default
users-admin has been replaced with a gnome-control-center applet in GNOME 3, and it uses useradd, so I don''t really care now. Feel free to close the bug. (Note though that useradd seems to allow dots in usernames on most platforms, which probably suffer from the same potential problems as Debian.)