Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 62084 - username or groupname with spaces = /etc/bashrc error
username or groupname with spaces = /etc/bashrc error
Product: Red Hat Public Beta
Classification: Retired
Component: bash (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: wdovlrrw
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2002-03-27 04:51 EST by Adam Gibson
Modified: 2007-04-18 12:41 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-06-10 10:54:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Adam Gibson 2002-03-27 04:51:35 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020311

Description of problem:
This issue happens with all versions of redhat from 7.1 I have tested lately up
to the current skipjack beta(beta 1 at this time).  When your group name has
spaces in it "Domain Admin", the /etc/bashrc file will show the error below when
evaluating the group name in the bashrc script itself.

[: too many arguments

user's user name is "DOMAIN+username"
user's group name is "Domain Admins"

[static@leeloo static]$ ssh -4 DOMAIN+username@hostname
DOMAIN+username@'s password: 
Last login: Mon Mar 25 22:49:12 2002
[: too many arguments
[DOMAIN+username@hostname somedirectory]$

The problem is that the line below in /etc/bashrc does a string compare on the
group name result of `id -gn` and `id -un` but does not not put quotes around
the two.
if [ `id -gn` = `id -un` -a `id -u` -gt 99 ]; then

Simple fixed line:
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then

I did not do a search for any other issues like this yet but assume there have
to be a few more things like this.

This problem was discovered while using winbindd which maps windows users/groups
to unix.

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

How reproducible:

Steps to Reproduce:
1. create a username or groupname with a space in the name
2. login :)
3. watch the error from /etc/bashrc appear


Actual Results:  Got the error:

[: too many arguments

as i logged in.

Expected Results:  not to get an error? :)

Additional info:
Comment 1 Bernhard Rosenkraenzer 2002-06-10 10:54:45 EDT
Spaces are not valid characters in a user and group name. 
If winbindd creates users/groups with spaces in them, winbindd needs fixing.

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