From: Uri Simchoni Date: Tue, 29 Mar 2016 20:05:09 +0000 (+0300) Subject: nt-quotas: return 0 as indication of no quota X-Git-Tag: tdb-1.3.9~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78ae852dd7b6491e131d3a26f490bbcef53aa3d6;p=thirdparty%2Fsamba.git nt-quotas: return 0 as indication of no quota 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c index a36196b817b..b9fd2f13802 100644 --- a/source3/smbd/ntquotas.c +++ b/source3/smbd/ntquotas.c @@ -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; }