[PATCH] xfsprogs: xfs_quota allow user or group names beginning with digits

Dave Chinner david at fromorbit.com
Sun Apr 21 21:45:01 CDT 2013


On Wed, Apr 17, 2013 at 01:32:53PM -0500, rjohnston at sgi.com wrote:
> 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 at sgi.com>
> 
> ---
>  include/input.h |    1 +
>  libxcmd/input.c |   12 ++++++++++++
>  quota/quota.c   |    4 ++--
>  quota/quota.h   |    1 +
>  4 files changed, 16 insertions(+), 2 deletions(-)
> 
> Index: b/include/input.h
> ===================================================================
> --- a/include/input.h
> +++ b/include/input.h
> @@ -46,6 +46,7 @@ extern void	timestr(struct timeval *tv,
>  extern uid_t	uid_from_string(char *user);
>  extern gid_t	gid_from_string(char *group);
>  extern prid_t	prid_from_string(char *project);
> +extern boolean_t isdigits_only(const char *str);

bool is the correct type, not boolean_t. My CRC patchset makes
userspace fall in line with the removal of boolean_t from the kernel
code, so we should probably make this correct from the start. ;)

Cheers,

Dave.
-- 
Dave Chinner
david at fromorbit.com



More information about the xfs mailing list