summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorBjoern Jacke <bj@sernet.de>2019-01-30 21:57:38 -0600
committerBjoern Jacke <bjacke@samba.org>2019-02-17 13:33:14 +0100
commit7859ebc55a4a61747902921c7616f77a0c73934e (patch)
treeb09aeb309547b75f2776082b08c17a356b95ddd0 /source3
parent0c9c51fa7a69e1807c773a04247828046e98c7fc (diff)
downloadsamba-7859ebc55a4a61747902921c7616f77a0c73934e.tar.gz
quotas: remove legacy AIX quota code that is covered by sysquotas now
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/quotas.c122
1 files changed, 0 insertions, 122 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 2f18e368b17..c9472682f8f 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -335,128 +335,6 @@ bool disk_quotas(connection_struct *conn, struct smb_filename *fname,
return true;
}
-
-#else /* not Solaris */
-
-#if AIX
-/* AIX quota patch from Ole Holm Nielsen <ohnielse@fysik.dtu.dk> */
-#include <jfs/quota.h>
-/* AIX 4.X: Rename members of the dqblk structure (ohnielse@fysik.dtu.dk) */
-#define dqb_curfiles dqb_curinodes
-#define dqb_fhardlimit dqb_ihardlimit
-#define dqb_fsoftlimit dqb_isoftlimit
-#ifdef _AIXVERSION_530
-#include <sys/statfs.h>
-#include <sys/vmount.h>
-#endif /* AIX 5.3 */
-#else /* !AIX */
-#include <sys/quota.h>
-#include <devnm.h>
-#endif
-
-
-/****************************************************************************
-try to get the disk space from disk quotas - default version
-****************************************************************************/
-
-bool disk_quotas(connection_struct *conn, struct smb_filename *fname,
- uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
-{
- int r;
- struct dqblk D;
- uid_t euser_id;
- const char *path = fname->base_name;
-#if !defined(AIX)
- char dev_disk[256];
- SMB_STRUCT_STAT S = fname->st;
-
- /* find the block device file */
-
- if ((sys_stat(path, &S, false)<0)
- || (devnm(S_IFBLK, S.st_ex_dev, dev_disk, 256, 0)<0))
- return (False);
-
-#endif /* !defined(AIX) */
-
- euser_id = geteuid();
-
-#if defined(AIX)
- /* AIX has both USER and GROUP quotas:
- Get the USER quota (ohnielse@fysik.dtu.dk) */
-#ifdef _AIXVERSION_530
- {
- struct statfs statbuf;
- quota64_t user_quota;
- if (statfs(path,&statbuf) != 0)
- return False;
- if(statbuf.f_vfstype == MNT_J2)
- {
- /* For some reason we need to be root for jfs2 */
- become_root();
- r = quotactl(path,QCMD(Q_J2GETQUOTA,USRQUOTA),euser_id,(char *) &user_quota);
- unbecome_root();
- /* Copy results to old struct to let the following code work as before */
- D.dqb_curblocks = user_quota.bused;
- D.dqb_bsoftlimit = user_quota.bsoft;
- D.dqb_bhardlimit = user_quota.bhard;
- D.dqb_curfiles = user_quota.iused;
- D.dqb_fsoftlimit = user_quota.isoft;
- D.dqb_fhardlimit = user_quota.ihard;
- }
- else if(statbuf.f_vfstype == MNT_JFS)
- {
-#endif /* AIX 5.3 */
- save_re_uid();
- if (set_re_uid() != 0)
- return False;
- r= quotactl(path,QCMD(Q_GETQUOTA,USRQUOTA),euser_id,(char *) &D);
- restore_re_uid();
-#ifdef _AIXVERSION_530
- }
- else
- r = 1; /* Fail for other FS-types */
- }
-#endif /* AIX 5.3 */
-#else /* !AIX */
- r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);
-#endif /* !AIX */
-
- /* Use softlimit to determine disk space, except when it has been exceeded */
- *bsize = 1024;
-
- if (r)
- {
- if (errno == EDQUOT)
- {
- *dfree =0;
- *dsize =D.dqb_curblocks;
- return (True);
- }
- else return(False);
- }
-
- /* If softlimit is zero, set it equal to hardlimit.
- */
-
- if (D.dqb_bsoftlimit==0)
- D.dqb_bsoftlimit = D.dqb_bhardlimit;
-
- if (D.dqb_bsoftlimit==0)
- return(False);
- /* Use softlimit to determine disk space, except when it has been exceeded */
- if ((D.dqb_curblocks>D.dqb_bsoftlimit)
-||((D.dqb_curfiles>D.dqb_fsoftlimit) && (D.dqb_fsoftlimit != 0))
- ) {
- *dfree = 0;
- *dsize = D.dqb_curblocks;
- }
- else {
- *dfree = D.dqb_bsoftlimit - D.dqb_curblocks;
- *dsize = D.dqb_bsoftlimit;
- }
- return (True);
-}
-
#endif /* Solaris */
#else /* WITH_QUOTAS */