summaryrefslogtreecommitdiffstats
path: root/source/smbd/quotas.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-01-15 08:49:30 +0000
committerStefan Metzmacher <metze@samba.org>2004-01-15 08:49:30 +0000
commite9e5e2036f13ff847aa3ef52e8be657bef7d5774 (patch)
treeb3801d0fca719c8a1f2d4d2e690265ba2149e5d1 /source/smbd/quotas.c
parent5134c6bcbc5180431e95a30559c453f3744fd427 (diff)
downloadsamba-e9e5e2036f13ff847aa3ef52e8be657bef7d5774.tar.gz
samba-e9e5e2036f13ff847aa3ef52e8be657bef7d5774.tar.xz
samba-e9e5e2036f13ff847aa3ef52e8be657bef7d5774.zip
* 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
Diffstat (limited to 'source/smbd/quotas.c')
-rw-r--r--source/smbd/quotas.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/smbd/quotas.c b/source/smbd/quotas.c
index 19f225e9737..c0b2db61730 100644
--- a/source/smbd/quotas.c
+++ b/source/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 */