Bug 178894 - tools for manipulating user and groups breaks IEEE POSIX standards on user/group names
tools for manipulating user and groups breaks IEEE POSIX standards on user/gr...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: shadow-utils (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-25 04:45 EST by Paolo Penzo
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-27 05:27:34 EST
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 Paolo Penzo 2006-01-25 04:45:31 EST
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 05:31:17 EST
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 03:41:47 EST
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 05:15:07 EST
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.