Bug 22920 - impossible to create account with period in login name
Bug#: 22920 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: base-system@gentoo.org Reported By: anigel@gentoo.org
Component: Core system
URL: 
Summary: impossible to create account with period in login name
Keywords:  
Status Whiteboard: 
Opened: 2003-06-16 05:04 0000
Description:   Opened: 2003-06-16 05:04 0000
I need to create accounts whose usernames contain periods (example : 
firstname.name).

adduser firstname.name tells me : adduser: invalid user name 'firstname.name'
and so does useradd.
Creating an account using the '-' character works, an i can change it 'by 
hand' in the password file. But not easy to script, and sounds dangerous :-P

As i need scripting accounts creation i can't use interactive tools such as 
superadduser.

Note : on debian, the same problem occurs with adduser, but not with useradd !!
And on Mandrake, no problem at all, the 2 commands accept periods...

Reproducible: Always
Steps to Reproduce:
1. adduser firstname.name
2. useradd firstname.name

Actual Results:  
invalid user name 'firstname.name'

And the system refuses to create the account

Expected Results:  
It should have created the account.

------- Comment #1 From Chuck Short (RETIRED) 2003-06-16 18:28:34 0000 -------
Created an attachment (id=13393) [details]
Patch to allow user to create a username with a "."

Patch allows users to create a username with a ".".

------- Comment #2 From Chuck Short (RETIRED) 2003-06-16 18:29:49 0000 -------
Created an attachment (id=13394) [details]
Patch to add my patch to shadow-4.0.3-r6

This adds an extra two lines to the ebuild so that the
shadow-4.0.3-chkname.patch to be used.

------- Comment #3 From Chuck Short (RETIRED) 2003-06-16 18:31:35 0000 -------
Hi,


I have verified that you cant add username with a period in it. I get a invalid username error message.

This patch allows the username to have a period. I have tested with bot adduser and useradd. It worked fine when using adduser and useradd.

chuck

------- Comment #4 From Hubert Mercier (RETIRED) 2003-06-17 02:27:28 0000 -------
OK, works for me too.

But i don't know how to change the bug status to 'solved' (i read the patch, i see no reason to test anymore ;-).

Will it be incorporated to next version of shadow ? I hope so ;-)

Thanks again !


------- Comment #5 From Ivan Havlicek 2004-07-16 09:22:23 0000 -------
I emerge a new version today (sys-apps/shadow-4.0.4.1-r3) and the bug is still
there !

------- Comment #6 From phceac@yahoo.com 2004-08-11 14:29:28 0000 -------
This looks like Bug 37402 - see discussion there.

------- Comment #7 From Hubert Mercier (RETIRED) 2004-09-21 09:11:51 0000 -------
Well, i am still annoyed with this problem, so i was wondering if the patch
would be one day incorporated to the gentoo package ?

This is really boring to have to patch every new server I install...

(I now use Gentoo in a professional way, to host several hundreds of users;
some of them have the same name, so using firstname.lastname as a login is
usefull for me.)

Thanks in advance :)

------- Comment #8 From SpanKY 2004-09-21 10:51:11 0000 -------
*** Bug 37402 has been marked as a duplicate of this bug. ***

------- Comment #9 From SpanKY 2004-09-21 10:54:57 0000 -------
i'll make you a deal ... update the patch to fail if the _POSIX2_VERSION env
var is set to a date less than some target date (i'll find the target date in a
bit, it doesnt matter ...) and i'll add the patch to our shadow

the only real concern i have is with coreutils' chown ... it checks the
_POSIX2_VERSION env var to see if the '.' is a separator

------- Comment #10 From Hubert Mercier (RETIRED) 2004-09-21 11:41:39 0000 -------
My english isn't perfect, but I think I understood the problem. In fact, I
didn't matter about the chown problem since I never used this syntax (always
used ":" as separator).

So, the problem is to check the _POSIX2_VERSION, to see if it is posterior to a
date of your choice, in order to "disable" the old syntax in chown ? Yes / No ?
^^

Sorry, but I told you in the beginning : english not perfect :( .

------- Comment #11 From SpanKY 2004-09-21 15:20:30 0000 -------
ah forget about it

i'll get seemant to remove the '.' compatibility of coreutils and we'll have the newer shadow DEPEND on it

------- Comment #12 From SpanKY 2005-01-09 22:34:39 0000 -------
ok, ive added '.' support to shadow-4.0.6 (no version bump)

------- Comment #13 From Hubert Mercier (RETIRED) 2005-01-10 01:43:25 0000 -------
Thanks a lot, I thought this bug was left back ;-) !