summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-03-22 17:31:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:12 -0500
commitcf99ec82969f6d3c553472028bd9aa2112ef35d4 (patch)
tree835e9b99572b259ae19848cd37f7af986a259d5c
parentec139622c51075012dce3ce124e051975b5bdd62 (diff)
downloadsamba-cf99ec82969f6d3c553472028bd9aa2112ef35d4.tar.gz
samba-cf99ec82969f6d3c553472028bd9aa2112ef35d4.tar.bz2
samba-cf99ec82969f6d3c553472028bd9aa2112ef35d4.zip
r5958: BUG 1843: patch from james peach to fix quotas (with no soft limits) on IRIX
(This used to be commit aeb3cea54ea2e050aef38e38fd8519510a14a184)
-rw-r--r--source3/smbd/quotas.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 1117461bc2..1a73fdf222 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -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;
}
}