From faaaae3c57977b6041d0bac99ff696c4760fdb01 Mon Sep 17 00:00:00 2001 From: Uri Simchoni Date: Wed, 30 Mar 2016 14:05:49 +0300 Subject: [PATCH] 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 --- source3/lib/sysquotas_4A.c | 16 ++-------------- source3/lib/sysquotas_linux.c | 9 +-------- 2 files changed, 3 insertions(+), 22 deletions(-) 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(); -- 2.47.3