]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r5958: BUG 1843: patch from james peach to fix quotas (with no soft limits) on IRIX
authorGerald Carter <jerry@samba.org>
Tue, 22 Mar 2005 17:31:23 +0000 (17:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:56:12 +0000 (10:56 -0500)
source/smbd/quotas.c

index 1117461bc25477ad133c1f6e2999e72a6e872014..1a73fdf2223a9c3e10c808f99104eac140c3ee53 100644 (file)
@@ -882,8 +882,17 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
     restore_re_uid();
 
     if (r==-1)
+    {
+      DEBUG(5, ("quotactl for uid=%u: %s", euser_id, strerror(errno)));
       return(False);
+    }
         
+    /* No quota for this user. */
+    if (F.d_blk_softlimit==0 && F.d_blk_hardlimit==0)
+    {
+      return(False);
+    }
+
     /* Use softlimit to determine disk space, except when it has been exceeded */
     if (
         (F.d_blk_softlimit && F.d_bcount>=F.d_blk_softlimit) ||
@@ -895,14 +904,10 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
       *dfree = 0;
       *dsize = F.d_bcount;
     }
-    else if (F.d_blk_softlimit==0 && F.d_blk_hardlimit==0)
-    {
-      return(False);
-    }
     else 
     {
       *dfree = (F.d_blk_softlimit - F.d_bcount);
-      *dsize = F.d_blk_softlimit;
+      *dsize = F.d_blk_softlimit ? F.d_blk_softlimit : F.d_blk_hardlimit;
     }
 
   }