summaryrefslogtreecommitdiff
path: root/source3/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
commit9343c89cb4a1b9f47c38d00b12f3e9058d15b18d (patch)
tree461dc0cac32b943f138f057c0d992034db18000c /source3/smbd/quotas.c
parent919c261a490460a2e2189903139c0d4ad36a7aab (diff)
downloadsamba-9343c89cb4a1b9f47c38d00b12f3e9058d15b18d.tar.gz
samba-9343c89cb4a1b9f47c38d00b12f3e9058d15b18d.tar.bz2
samba-9343c89cb4a1b9f47c38d00b12f3e9058d15b18d.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 (This used to be commit e9e5e2036f13ff847aa3ef52e8be657bef7d5774)
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 */