From 9343c89cb4a1b9f47c38d00b12f3e9058d15b18d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 15 Jan 2004 08:49:30 +0000 Subject: * 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) --- source3/smbd/ntquotas.c | 3 +++ source3/smbd/quotas.c | 17 +++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c index 88d7c4e164..555f32d773 100644 --- a/source3/smbd/ntquotas.c +++ b/source3/smbd/ntquotas.c @@ -20,6 +20,9 @@ #include "includes.h" +#undef DBGC_CLASS +#define DBGC_CLASS DBGC_QUOTA + static SMB_BIG_UINT limit_nt2unix(SMB_BIG_UINT in, SMB_BIG_UINT bsize) { SMB_BIG_UINT ret = (SMB_BIG_UINT)0; 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 */ -- cgit