From: Leo Baltus Date: Fri, 2 Jan 2009 18:23:58 +0000 (+0100) Subject: xfs_quota: fix input of a projectid which starts whith a digit X-Git-Tag: v3.0.0~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d9d5700e2dfc7f3d36c23d2638de1872dafcee3;p=thirdparty%2Fxfsprogs-dev.git 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 --- 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)