Bug 178894 - tools for manipulating user and groups breaks IEEE POSIX standards on user/group names
Summary: tools for manipulating user and groups breaks IEEE POSIX standards on user/gr...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: shadow-utils
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-01-25 09:45 UTC by Paolo Penzo
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-01-27 10:27:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Paolo Penzo 2006-01-25 09:45:31 UTC
The tools for manipulating user and group shipped with shadow-utils (groupadd,
useradd, usermod, groupmod...) beaks the IEEE POSIX standard on user and group
names since users or group with capital letters are not allowed.
As far as I know, this issue was present in RHEL 3.0 and removed in later
update. Update 5 (shadow-utils-4.0.3-23.08) reintroduced it. RHEL 4.0 Update 2
(shadow-utils-4.0.3-52) is not affected.

To reproduce it run
useradd User
or 
groupadd Group

Expected results:
User and group names with capital letters should be allowed.

Comment 1 Peter Vrabec 2006-01-26 10:31:17 UTC
I think this behaviour is same in RHEL-3/4, FC-*, and devel.
$ cat libmisc/chkname.c
...
        /*
         * User/group names must match gnu e-regex:
         *   [a-zA-Z0-9_.][a-zA-Z0-9_-.]{0,30}[a-zA-Z0-9_.$-]?
         *
         * as a non-POSIX, extension, allow "$" as the last char for
         * sake of Samba 3.x "add machine script"
         */
...

I have no bug reports about this.

Comment 2 Paolo Penzo 2006-01-27 08:41:47 UTC
In shadow-utils-4.0.3-23.08 (and 4.0.3-25.RHEL3, the last update for RHL 3) the
code looks very much different,

libmisc/chkname.c:
...
static int
good_name(const char *name)
{
        /*
         * User/group names must match [a-z_][a-z0-9_-]*
         */
        if (!*name || !((*name >= 'a' && *name <= 'z') || *name == '_'))
                return 0;

        while (*++name) {
                if (!((*name >= 'a' && *name <= 'z') ||
                    (*name >= '0' && *name <= '9') ||
                    *name == '_' || *name == '-' ||
                    (*name == '$' && *(name+1) == NULL)))
                        return 0;
        }

        return 1;
}
...

I think you have no bugs report on this since user/group names with capital
letters are not frequent.

Comment 3 Peter Vrabec 2006-01-27 10:15:07 UTC
Yes but this will be changed in shadow-utils-4.0.3-26.RHEL3, so it's going to be
same. I think there are some other characters("$","."), which are engaged, but
they break POSIX standard.
I want to close this bug until there are some bug reports about capital letters
in usernames.


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