Bug 120669 - test to allow - and _ in usernames is too generous [has patch]
Summary: test to allow - and _ in usernames is too generous [has patch]
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-users
Version: rawhide
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Brent Fox
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-04-12 20:44 UTC by Matthew Miller
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-04-15 18:22:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
allow - _ in names without ignoring further characters (1.45 KB, patch)
2004-04-15 17:22 UTC, Matthew Miller
no flags Details | Diff

Description Matthew Miller 2004-04-12 20:44:17 UTC
Description of problem:

Sometime between redhat-config-users and now, this bit of code

        if i == "_" or i == "-":
            #specifically allow "_" and "-"
            return 1
        
was added to isUsernameOk() from asciiCheck.py. This is in a loop
which checks each character for okayness. The problem: if a - or _
occurs anywhere in the given username, the entire rest of the name is
passed without checking. So, one can give a username like "foo- b a
r", resulting in a runtime error (I assume from libuser) and a hung GUI.

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

Not sure when this started, but it's in the test2 package, and it's in
1.2.11-4, which is the latest in the development tree.

How reproducible:

always

Steps to Reproduce:
1. hit the Add User button
2. enter "- blah" for a username
3. enter some password
4. hit OK
5. Boom!
  
Actual results:

Dialog goes gray and freezes; RuntimeError on console.

Expected results:

A pretty "don't do that!" warning message.

Additional info:

An alternate approach... instead of the whole new check, modify the
"if i in string.punctuation" one and either reduce what
string.punctuation is or add a second "oh except" check.

Comment 1 Matthew Miller 2004-04-15 17:21:19 UTC
Looks like this was added in 1.1.16-1 in response to bug #99115....

Comment 2 Matthew Miller 2004-04-15 17:22:44 UTC
Created attachment 99448 [details]
allow - _ in names without ignoring further characters

here, try this instead. :)

Comment 3 Matthew Miller 2004-04-15 18:08:43 UTC
Oh -- my patch doesn't fid the same problem in isGroupnameOk. But you
get the idea. :)

Comment 4 Brent Fox 2004-04-15 18:22:59 UTC
Should be fixed in system-config-users-1.2.12-1 and firstboot-1.3.11-1
in Rawhide.  Thanks for your report.


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