]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_quota: fully support users and groups beginning with digits
authorZorro Lang <zlang@redhat.com>
Tue, 10 May 2016 07:16:06 +0000 (17:16 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 10 May 2016 07:16:06 +0000 (17:16 +1000)
commitcef37d5a0ef68351ea97518249b0c91746e700e3
tree1ba07fdc011284a39987c8e7b81411114c8fc1f6
parent2354bb66e1718ddd72f2983424f5a1f76ca43192
xfs_quota: fully support users and groups beginning with digits

A normal user or group name allow beginning with digits, but xfs_quota
can't create a limit for that user or group. The reason is 'strtoul'
function only translate digits at the beginning, it will ignore
letters after digits.

There's a commit fd537fc50eeade63bbd2a66105f39d04a011a7f5, it try to
fix "xfsprogs: xfs_quota allow user or group names beginning with
digits". But it doesn't effect 'limit' command, so a command likes:

  xfs_quota 'limit .... 12345678-user' xxxx

will try to create limit for username="12345678", not "12345678-user".

This patch will fix this problem, and a test case xfs/138 in xfstests
is used to reproduce this bug.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxcmd/input.c