From 78ae852dd7b6491e131d3a26f490bbcef53aa3d6 Mon Sep 17 00:00:00 2001 From: Uri Simchoni Date: Tue, 29 Mar 2016 23:05:09 +0300 Subject: [PATCH] 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 --- source3/smbd/ntquotas.c | 8 -------- 1 file changed, 8 deletions(-) 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; } -- 2.47.3