public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Bug#705483: xfsprogs: xfs_quota misinterprets usernames with leading digits
@ 2013-04-15 14:46 James Carter
  2013-04-15 16:07 ` Rich Johnston
  2013-04-23 13:02 ` Rich Johnston
  0 siblings, 2 replies; 5+ messages in thread
From: James Carter @ 2013-04-15 14:46 UTC (permalink / raw)
  To: submit

Subject: xfsprogs: xfs_quota misinterprets usernames with leading digits
Package: xfsprogs
Version: 3.1.4
Severity: normal

*** Please type your report below this line ***

xfs_quota interprets usernames with leading digits as a numeric UID so,
for example:

# xfs_quota -c 'quota -h -u 2000ad' /store
Disk quotas for User test (2000)
Filesystem   Blocks  Quota  Limit Warn/Time    Mounted on
/dev/sdb1       12K     1G     1G  00 [------] /store

This is returning quota information for the user "test" (UID 2000), rather
than the user "2000ad".

-- System Information:
Debian Release: 6.0.7
   APT prefers stable
   APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-0.bpo.4-amd64 (SMP w/12 CPU cores)
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=UTF-8) (ignored: LC_ALL set 
to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages xfsprogs depends on:
ii  libblkid1                     2.17.2-9   block device id library
ii  libc6                         2.11.3-4   Embedded GNU C Library: 
Shared lib
ii  libreadline5                  5.2-7      GNU readline and history 
libraries
ii  libuuid1                      2.17.2-9   Universally Unique ID library

xfsprogs recommends no packages.

Versions of packages xfsprogs suggests:
pn  acl <none>     (no description available)
pn  attr <none>     (no description available)
pn  quota <none>     (no description available)
pn  xfsdump <none>     (no description available)

-- no debconf information

-- 
James Carter                                           Bytemark Hosting
                                              http://www.bytemark.co.uk/
                                               tel: +44 (0) 1904 890 890

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Bug#705483: xfsprogs: xfs_quota misinterprets usernames with leading digits
  2013-04-15 14:46 Bug#705483: xfsprogs: xfs_quota misinterprets usernames with leading digits James Carter
@ 2013-04-15 16:07 ` Rich Johnston
  2013-04-16  8:17   ` James Carter
  2013-04-23 13:02 ` Rich Johnston
  1 sibling, 1 reply; 5+ messages in thread
From: Rich Johnston @ 2013-04-15 16:07 UTC (permalink / raw)
  To: James Carter, 705483; +Cc: submit

On 04/15/2013 09:46 AM, James Carter wrote:
> Subject: xfsprogs: xfs_quota misinterprets usernames with leading digits
> Package: xfsprogs
> Version: 3.1.4
> Severity: normal
>
> *** Please type your report below this line ***
>
> xfs_quota interprets usernames with leading digits as a numeric UID so,
> for example:
>
> # xfs_quota -c 'quota -h -u 2000ad' /store
> Disk quotas for User test (2000)
> Filesystem   Blocks  Quota  Limit Warn/Time    Mounted on
> /dev/sdb1       12K     1G     1G  00 [------] /store
>
> This is returning quota information for the user "test" (UID 2000), rather
> than the user "2000ad".
>

I don't think this is a bug, username must begin with a character 
(unless you created the user using NIS or adduser --force-badname).

# Default from /etc/adduser.conf
# check user and group names also against this regular expression.
#NAME_REGEX="^[a-z][-a-z0-9_]*\$"

 From adduser man page:

       --force-badname
                By default, user and group names are checked against the 
config‐
                urable regular expression NAME_REGEX  (or 
NAME_REGEX_SYSTEM  if
               --system is specified) specified in the configuration 
file. This
               option forces adduser and addgroup to apply only  a  weak 
  check
               for validity of the name.

Thanks
--Rich

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Bug#705483: xfsprogs: xfs_quota misinterprets usernames with leading digits
  2013-04-15 16:07 ` Rich Johnston
@ 2013-04-16  8:17   ` James Carter
  2013-04-16 12:29     ` Rich Johnston
  0 siblings, 1 reply; 5+ messages in thread
From: James Carter @ 2013-04-16  8:17 UTC (permalink / raw)
  To: 705483

On 15/04/13 17:07, Rich Johnston wrote:
>
> I don't think this is a bug, username must begin with a character 
> (unless you created the user using NIS or adduser --force-badname).

My understanding that this is a recommendation rather than a 
requirement. useradd(8) has the following to say:

        On Debian, the only constraints are that usernames must neither 
start
        with a dash ('-') nor contain a colon (':') or a whitespace 
(space: '
        ', end of line: '\n', tabulation: '\t', etc.). Note that using a 
slash
        ('/') may break the default algorithm for the definition of the 
user's
        home directory.

In any case, I'd still consider it a bug that trailing non-numeric 
characters were just silently ignored.

-- 
James Carter                                           Bytemark Hosting
                                              http://www.bytemark.co.uk/
                                               tel: +44 (0) 1904 890 890

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Bug#705483: xfsprogs: xfs_quota misinterprets usernames with leading digits
  2013-04-16  8:17   ` James Carter
@ 2013-04-16 12:29     ` Rich Johnston
  0 siblings, 0 replies; 5+ messages in thread
From: Rich Johnston @ 2013-04-16 12:29 UTC (permalink / raw)
  To: James Carter, 705483

On 04/16/2013 03:17 AM, James Carter wrote:
> On 15/04/13 17:07, Rich Johnston wrote:
>>
>> I don't think this is a bug, username must begin with a character
>> (unless you created the user using NIS or adduser --force-badname).
>
> My understanding that this is a recommendation rather than a
> requirement. useradd(8) has the following to say:
>
>         On Debian, the only constraints are that usernames must neither
> start
>         with a dash ('-') nor contain a colon (':') or a whitespace
> (space: '
>         ', end of line: '\n', tabulation: '\t', etc.). Note that using a
> slash
>         ('/') may break the default algorithm for the definition of the
> user's
>         home directory.
>
> In any case, I'd still consider it a bug that trailing non-numeric
> characters were just silently ignored.
>

Interesting I was not aware of the Debian difference.  My understanding 
was that usernames with leading digits would have trouble with other 
utilities on other versions of Unix and flavors of Linux as they would 
interpret the username as numeric UID.  I was able to create a user with 
leading digits and trailing alpha characters using vipw.  Because  chown 
works using this username, we will look into fixing this bug.  Thanks 
for pointing it out.

--Rich

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Bug#705483: xfsprogs: xfs_quota misinterprets usernames with leading digits
  2013-04-15 14:46 Bug#705483: xfsprogs: xfs_quota misinterprets usernames with leading digits James Carter
  2013-04-15 16:07 ` Rich Johnston
@ 2013-04-23 13:02 ` Rich Johnston
  1 sibling, 0 replies; 5+ messages in thread
From: Rich Johnston @ 2013-04-23 13:02 UTC (permalink / raw)
  To: James Carter, 705483; +Cc: submit

James,

The following commit will resolve the issue.

Thanks
--Rich

commit fd537fc50eeade63bbd2a66105f39d04a011a7f5
Author: Rich Johnston <rjohnston@sgi.com>
Date:   Mon Apr 22 17:32:05 2013 +0000

     xfsprogs: xfs_quota allow user or group names beginning with digits

     xfs_quota does not properly parse users or groups that begin with a 
number.
     Only call atoi when user or group consists of digits only.

     Signed-off-by: Rich Johnston <rjohnston@sgi.com>
     Reported-by: James Carter <james.carter@bytemark.co.uk>
     Reviewed-by: Eric Sandeen <sandeen@redhat.com>
     Reviewed-by: Chandra Seetharaman <sekharan@us.ibm.com>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-23 13:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-15 14:46 Bug#705483: xfsprogs: xfs_quota misinterprets usernames with leading digits James Carter
2013-04-15 16:07 ` Rich Johnston
2013-04-16  8:17   ` James Carter
2013-04-16 12:29     ` Rich Johnston
2013-04-23 13:02 ` Rich Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox