]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_quota: check for size parsing errors
authorEric Sandeen <sandeen@sandeen.net>
Fri, 27 Jan 2012 19:26:19 +0000 (13:26 -0600)
committerChristoph Hellwig <hch@lst.de>
Sun, 5 Feb 2012 14:00:35 +0000 (14:00 +0000)
commit7fd39587b16185b648743149f2801eb31ea2d85e
tree389acf1b5ce04ce908e0025197f8969de0e1f206
parente1f43b4c701b24d9b5bc85df858a8c36f0f0723b
xfs_quota: check for size parsing errors

Doing something like

# xfs_quota -x -c 'limit -u bhard=1.2g ...

will cause cvtnum to fail and return a value of -1LL (because it
cannot parse the decimal), but the quota caller doesn't check
for this error value, casts it to U64, shifts right, and we end
up with an answer of 16 petabytes rather than erroring out.
Fix this.

Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Reported-by: James Lawrie <james@jdlawrie.co.uk>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
quota/edit.c