From: Uri Simchoni Date: Wed, 30 Mar 2016 11:05:49 +0000 (+0300) Subject: sys-quotas: do not fail if user has no quota X-Git-Tag: tdb-1.3.9~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=faaaae3c57977b6041d0bac99ff696c4760fdb01;p=thirdparty%2Fsamba.git sys-quotas: do not fail if user has no quota If the user/group has no quota, do not treat that as error condition. Instead, return zero quota. Signed-off-by: Uri Simchoni Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/sysquotas_4A.c b/source3/lib/sysquotas_4A.c index 244b612c11f..674c4ee02db 100644 --- a/source3/lib/sysquotas_4A.c +++ b/source3/lib/sysquotas_4A.c @@ -104,13 +104,7 @@ int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt return ret; } - if ((D.dqb_curblocks==0)&& - (D.dqb_bsoftlimit==0)&& - (D.dqb_bhardlimit==0)) { - /* the upper layer functions don't want empty quota records...*/ - return -1; - } - + ret = 0; break; #ifdef HAVE_GROUP_QUOTA case SMB_GROUP_QUOTA_TYPE: @@ -121,13 +115,7 @@ int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt return ret; } - if ((D.dqb_curblocks==0)&& - (D.dqb_bsoftlimit==0)&& - (D.dqb_bhardlimit==0)) { - /* the upper layer functions don't want empty quota records...*/ - return -1; - } - + ret = 0; break; #endif /* HAVE_GROUP_QUOTA */ case SMB_USER_FS_QUOTA_TYPE: diff --git a/source3/lib/sysquotas_linux.c b/source3/lib/sysquotas_linux.c index bf3504ae03c..5984626425b 100644 --- a/source3/lib/sysquotas_linux.c +++ b/source3/lib/sysquotas_linux.c @@ -447,14 +447,7 @@ int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt } } } - - if ((dp->curblocks==0)&& - (dp->softlimit==0)&& - (dp->hardlimit==0)) { - /* the upper layer functions don't want empty quota records...*/ - return -1; - } - + ret = 0; break; case SMB_USER_FS_QUOTA_TYPE: id.uid = getuid();