nt-quotas: return 0 as indication of no quota
authorUri Simchoni <uri@samba.org>
Tue, 29 Mar 2016 20:05:09 +0000 (23:05 +0300)
committerJeremy Allison <jra@samba.org>
Thu, 31 Mar 2016 18:30:10 +0000 (20:30 +0200)
When getting user quota, the correct value to indicate "no quota"
is 0, not -1.

In [MS-FSCC] section 2.4.33 it is written that -1 designates no-quota.
However, careful read of that section shows that this designation is only
true when setting the quota, and this section says nothing about getting
the quota.

In [MS-FSA] section 2.1.5.20, it is written that "If SidList includes a SID
that does not map to an existing SID in the Open.File.Volume.QuotaInformation
list, the object store MUST return a FILE_QUOTA_INFORMATION structure
(as specified in [MS-FSCC] section 2.4.33) that is filled with zeros.

This is also verified experimentally and cleared with dochelp.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/ntquotas.c

index a36196b817bbe12815c6f16b45e4e0a634e9fcf8..b9fd2f13802e735da5dacfd1f82a4382481aaf86 100644 (file)
@@ -53,14 +53,6 @@ static uint64_t limit_unix2nt(uint64_t in, uint64_t bsize)
 
        ret = (uint64_t)(in*bsize);
        
-       if (ret < in) {
-               /* we overflow */
-               ret = SMB_NTQUOTAS_NO_LIMIT;
-       }
-
-       if (in == SMB_QUOTAS_NO_LIMIT)
-               ret = SMB_NTQUOTAS_NO_LIMIT;
-
        return ret;
 }