Bug 141273 - system-config-users doesn't allow punctuation
system-config-users doesn't allow punctuation
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: system-config-users (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nils Philippsen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-29 18:19 EST by Mike Hawkstarrr
Modified: 2007-11-30 17:10 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-23 10:57:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike Hawkstarrr 2004-11-29 18:19:10 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; 
SV1; .NET CLR 1.1.4322)

Description of problem:
I have seen the patch for shadow-utils to fix the punctuation problem 
when entering users in the console, and it worked fine. 
However, for some reason, when trying to add or edit a user whose 
name contains some sort of punctuation (user.name) it bring an error 
and doesn't allow any change to be made, or the new user to be added.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.open gnome useradd program
2.enter user.name
3.click ok
    

Actual Results:  error appears disallowing user because name included 
invalid character

Expected Results:  user should have been entered, without problem.

Additional info:
Comment 1 Eido Inoue 2004-12-01 15:07:42 EST
the newest useradd (part of shadow-utils) does allow some punctuation
(underscore, period, dash (but not as the first char), and dollar sign
(only as the last char; use discouraged; for samba interoperability)

e-regex syntax is:

[A-Za-z0-9_.][A-Za-z0-9_.-]{0,15}

(This is what POSIX recommends for user/group names) 

the gnome-useradd (assuming you mean system-config-users) uses a
different validator. changing component.
Comment 2 Mike Hawkstarrr 2004-12-01 17:12:00 EST
Maybe an update has been made since the last time I tried using 
system-config-users (it was about 2 months ago), but the validator 
for this program also does not allow a '.' in the name. Has a patch 
been made to fix this problem?
Comment 3 Nils Philippsen 2004-12-03 06:50:56 EST
Adrian, the code in s-c-users checks for length <= 32 chars, while your regex
only allows for up to 16 chars. Do you know what actually is the max length for
Linux user names?
Comment 4 Eido Inoue 2004-12-03 15:23:53 EST
comment 3: should be length <= sizeof(ut.ut_user)... which is (currently) 16
chars. See bug 56850
Comment 5 Nils Philippsen 2004-12-03 16:46:34 EST
Miloslav: I'll hard code 31 chars max for now (which breaks strings
BTW, therefore only in CVS first), then I'll bump this one to you to
implement libuser giving me that info, when you're ready bump it back
to me so I can remove the hardcoded things, ok?
Comment 7 Nils Philippsen 2004-12-06 09:42:45 EST
Adrian,

current s-c-users code checks that user/group names don't have a digit as their
first character, probably to avoid things like user "123" having uid "321" ;-).
I guess I'll leave that enforcement in place, it's sensible IMO. What do you think?
Comment 8 Nils Philippsen 2004-12-06 09:45:43 EST
Hmm, maybe enforcing one alpha character minimum would be better. Opinions?
Comment 9 Eido Inoue 2004-12-06 12:55:25 EST
comment 7,8: i certainly can see where one would want at least one alpha
character or the first character be non-numeric. However, posix is pretty clear
that all numeric user and group names are ok-- and useradd/etc don't seem to
have a problem with number-only user/group names.
Comment 10 Miloslav Trmač 2004-12-06 13:58:54 EST
(In reply to comment #9)
> However, posix is pretty clear
> that all numeric user and group names are ok-- and useradd/etc don't seem to
> have a problem with number-only user/group names.
They are nevertheless very impractical --- if the name is all-numeric and
there exists an user/group with that number, the string is interpreted as a
numeric ID, not a string.
This means that things like (chgrp $(id -gn)) stop working. They are not quite
portable, but I wouldn't think of the all-numeric possibility when writing
a script (without participating in this discussion, at least).

I'd suggest at least a warning for all-numeric names. Enforcing a restriction
not enforced by useradd seems to be a recipe for a "remove the restriction"
bug (:
Comment 12 Miloslav Trmač 2004-12-13 16:07:32 EST
libuser.UT_NAMESIZE is available from Python since libuser-0.53.1.
Comment 13 Nils Philippsen 2004-12-14 04:51:27 EST
This is great. I think I'll still harass the user for choosing all numeric user
names or other stuff ("If you want to shoot yourself in the foot, you can still
use command line tools" ;-).
Comment 14 David Timms 2004-12-17 21:24:59 EST
from comment #1:
useradd... does allow some punctuation
(underscore, period, dash (but not as the first char), and dollar sign
(only as the last char; use discouraged; for samba interoperability)

this is correct, a username with a trailing $ can be created, however,
the account cannot be edited in system-config-users (except that a
name change can be forced based on user input, that doesn't allow the
$), nor can an account with trailing $ be created.

As suggested above, a fix for both situations within s-c-u would help
samba interoperability. or should I submit a new bug ...?
Comment 15 Miloslav Trmač 2004-12-18 05:09:13 EST
"Samba interoperability" means, as far as I know, machine accounts.
There's not much you can reasonably do with such accounts (considering
the extra data samba stores), maybe except for deleting them.
Comment 16 Matthew Miller 2005-04-26 12:01:22 EDT
Fedora Core 2 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.
Comment 17 Nils Philippsen 2005-06-07 09:16:37 EDT
This problem is still present.
Comment 18 Nils Philippsen 2005-06-10 14:49:21 EDT
I've fixed this in s-c-users CVS.

Adrian, s-c-users should now behave as useradd/groupadd concerning the validity
of user names/group names -- with one exception: I don't allow a trailing "$" in
group names because AFAIK only user names get abused that way by Samba -- is
that assumption correct?
Comment 19 Eido Inoue 2005-06-10 16:10:49 EDT
(In reply to comment #18)
> I've fixed this in s-c-users CVS.
> 
> Adrian, s-c-users should now behave as useradd/groupadd concerning the validity
> of user names/group names -- with one exception: I don't allow a trailing "$" in
> group names because AFAIK only user names get abused that way by Samba -- is
> that assumption correct?

Correct, the allowing of the '$' is only for internal Samba user, so s-c-users
need not allow it.
Comment 20 Nils Philippsen 2005-09-23 10:57:29 EDT
Fixed in system-config-users-1.2.39-1.
Comment 21 Fedora Update System 2005-09-23 11:43:11 EDT
From User-Agent: XML-RPC

system-config-users-1.2.39-0.fc4.1 has been pushed for FC4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 22 Fedora Update System 2005-09-29 12:17:22 EDT
From User-Agent: XML-RPC

system-config-users-1.2.39-0.fc4.1 has been pushed for FC4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.