diff options
author | Petr Písař <ppisar@redhat.com> | 2011-01-07 13:53:13 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-10-04 21:57:07 +0200 |
commit | 803a300b63cc9065818354c1d11a8125dbbdb571 (patch) | |
tree | 0f8609b399776f33ecaee40b75e3d9d782984fea /rquota_client.c | |
parent | 7d2ac8097d65c6698124abd2dda25bffd8590aa7 (diff) |
Check set limits fit into the range supported by RPC transport
E.g. setquota -r root $((2**32)) 1000 10 10 /mnt/nfs/12tb
clamped the values into 32 bits and RPC server got 0 soft block limit.
This fixes simalar bug spotted in 8a4dc3612c6c170c05e5eef68dd3555baeb341c1
(Check whether set limits fit into the range supported by quota format.)
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'rquota_client.c')
-rw-r--r-- | rquota_client.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rquota_client.c b/rquota_client.c index d67dd25..54a8921 100644 --- a/rquota_client.c +++ b/rquota_client.c @@ -265,6 +265,10 @@ int rpc_rquota_set(int qcmd, struct dquot *dquot) char *fsname_tmp, *host, *pathname; struct timeval timeout = { 2, 0 }; + /* RPC limits values to 32b variables. Prevent value wrapping. */ + if (check_dquot_range(dquot) < 0) + return -ERANGE; + /* * Convert host:pathname to seperate host and pathname. */ |