From 1d9d5700e2dfc7f3d36c23d2638de1872dafcee3 Mon Sep 17 00:00:00 2001 From: Leo Baltus Date: Fri, 2 Jan 2009 19:23:58 +0100 Subject: [PATCH] xfs_quota: fix input of a projectid which starts whith a digit xfs_quota -x -c "project -s 123foo" would result in a lookup for directories belonging to project 123 Reviewed-by: Christoph Hellwig --- libxcmd/input.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libxcmd/input.c b/libxcmd/input.c index 4691f0213..7b04f6c23 100644 --- a/libxcmd/input.c +++ b/libxcmd/input.c @@ -339,8 +339,12 @@ prid_from_string( prid_t prid; char *sp; + /* + * Allow either a full numeric or a valid projectname, even + * if it starts with a digit. + */ prid = (prid_t)strtoul(project, &sp, 10); - if (sp != project) + if (*project != '\0' && *sp == '\0') return prid; prj = getprnam(project); if (prj) -- 2.47.2