summaryrefslogtreecommitdiff
path: root/source3/smbd/quotas.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-01-15 08:56:08 +0000
committerStefan Metzmacher <metze@samba.org>2004-01-15 08:56:08 +0000
commit4e8aec8ca8481cf2102ac3052c4ee1ff37ec2f7c (patch)
treecf69d2da995962ee2d35cd5e81dbe285a9b070cb /source3/smbd/quotas.c
parent913d1745ca902326ec39a9e8ae9e1f133fee5060 (diff)
downloadsamba-4e8aec8ca8481cf2102ac3052c4ee1ff37ec2f7c.tar.gz
samba-4e8aec8ca8481cf2102ac3052c4ee1ff37ec2f7c.tar.bz2
samba-4e8aec8ca8481cf2102ac3052c4ee1ff37ec2f7c.zip
merge:
* Fix XFS quotas: XFS_USER_QUOTA -> USRQUOTA XFS_GROUP_QUOTA -> GRPQUOTA * Fix disk_free calculation with group quotas. * Add debug class 'quota' and a lot of DEBUG()'s to the quota code. metze (This used to be commit 33c6ca3b4bc0898893b5d95ea2485b7694b9d198)
Diffstat (limited to 'source3/smbd/quotas.c')
-rw-r--r--source3/smbd/quotas.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 19f225e973..c0b2db6173 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -27,6 +27,9 @@
#include "includes.h"
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_QUOTA
+
#ifndef HAVE_SYS_QUOTAS
/* just a quick hack because sysquotas.h is included before linux/quota.h */
@@ -82,10 +85,10 @@ static int get_smb_linux_xfs_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
ZERO_STRUCT(D);
- ret = quotactl(QCMD(Q_XGETQUOTA,XFS_USER_QUOTA), path, euser_id, (caddr_t)&D);
+ ret = quotactl(QCMD(Q_XGETQUOTA,USRQUOTA), path, euser_id, (caddr_t)&D);
if (ret)
- ret = quotactl(QCMD(Q_XGETQUOTA,XFS_GROUP_QUOTA), path, egrp_id, (caddr_t)&D);
+ ret = quotactl(QCMD(Q_XGETQUOTA,GRPQUOTA), path, egrp_id, (caddr_t)&D);
if (ret)
return ret;
@@ -1195,7 +1198,8 @@ BOOL disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BI
unid_t id;
id.uid = geteuid();
-
+
+ ZERO_STRUCT(D);
r=sys_get_quota(path, SMB_USER_QUOTA_TYPE, id, &D);
/* Use softlimit to determine disk space, except when it has been exceeded */
@@ -1231,9 +1235,9 @@ BOOL disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BI
return True;
try_group_quota:
-#ifdef HAVE_GROUP_QUOTA
id.gid = getegid();
-
+
+ ZERO_STRUCT(D);
r=sys_get_quota(path, SMB_GROUP_QUOTA_TYPE, id, &D);
/* Use softlimit to determine disk space, except when it has been exceeded */
@@ -1267,8 +1271,5 @@ try_group_quota:
}
return (True);
-#else /* HAVE_GROUP_QUOTA */
- return False;
-#endif /* HAVE_GROUP_QUOTA */
}
#endif /* HAVE_SYS_QUOTAS */