]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
sys-quotas: do not fail if user has no quota
authorUri Simchoni <uri@samba.org>
Wed, 30 Mar 2016 11:05:49 +0000 (14:05 +0300)
committerJeremy Allison <jra@samba.org>
Thu, 31 Mar 2016 18:30:10 +0000 (20:30 +0200)
If the user/group has no quota, do not treat that as
error condition. Instead, return zero quota.

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

index 244b612c11fae2c6754d5c892ce39c8032354d30..674c4ee02db254a40992f0a9ca816d2d498aba29 100644 (file)
@@ -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:
index bf3504ae03c141a5f2437d987c99837ecf146272..5984626425b11bf0f514cdebd7ee5c1f096e53cd 100644 (file)
@@ -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();