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...
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: shadow-utils   
(Show other bugs)
Version: 3.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: David Lawrence
Depends On:
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:
Story Points: ---
Clone Of:
Last Closed: 2006-01-27 10:27:34 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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
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,

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.