summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/quotas.c129
1 files changed, 0 insertions, 129 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 77abb59d98e..ec7c63c86df 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -467,135 +467,6 @@ bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *d
return (True);
}
-#elif defined (IRIX6)
-/****************************************************************************
-try to get the disk space from disk quotas (IRIX 6.2 version)
-****************************************************************************/
-
-#include <sys/quota.h>
-#include <mntent.h>
-
-bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
-{
- uid_t euser_id;
- int r;
- struct dqblk D;
- struct fs_disk_quota F;
- SMB_STRUCT_STAT S;
- FILE *fp;
- struct mntent *mnt;
- SMB_DEV_T devno;
- int found;
-
- /* find the block device file */
-
- if ( sys_stat(path, &S, false) == -1 ) {
- return(False) ;
- }
-
- devno = S.st_ex_dev ;
-
- fp = setmntent(MOUNTED,"r");
- found = False ;
-
- while ((mnt = getmntent(fp))) {
- if ( sys_stat(mnt->mnt_dir, &S, false) == -1 )
- continue ;
- if (S.st_ex_dev == devno) {
- found = True ;
- break ;
- }
- }
- endmntent(fp) ;
-
- if (!found) {
- return(False);
- }
-
- euser_id=geteuid();
- become_root();
-
- /* Use softlimit to determine disk space, except when it has been exceeded */
-
- *bsize = 512;
-
- if ( 0 == strcmp ( mnt->mnt_type, "efs" ))
- {
- r=quotactl (Q_GETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &D);
-
- unbecome_root();
-
- if (r==-1)
- return(False);
-
- /* Use softlimit to determine disk space, except when it has been exceeded */
- if (
- (D.dqb_bsoftlimit && D.dqb_curblocks>=D.dqb_bsoftlimit) ||
- (D.dqb_bhardlimit && D.dqb_curblocks>=D.dqb_bhardlimit) ||
- (D.dqb_fsoftlimit && D.dqb_curfiles>=D.dqb_fsoftlimit) ||
- (D.dqb_fhardlimit && D.dqb_curfiles>=D.dqb_fhardlimit)
- )
- {
- *dfree = 0;
- *dsize = D.dqb_curblocks;
- }
- else if (D.dqb_bsoftlimit==0 && D.dqb_bhardlimit==0)
- {
- return(False);
- }
- else
- {
- *dfree = D.dqb_bsoftlimit - D.dqb_curblocks;
- *dsize = D.dqb_bsoftlimit;
- }
-
- }
- else if ( 0 == strcmp ( mnt->mnt_type, "xfs" ))
- {
- r=quotactl (Q_XGETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &F);
-
- unbecome_root();
-
- if (r==-1)
- {
- DEBUG(5, ("quotactl for uid=%u: %s", euser_id, strerror(errno)));
- return(False);
- }
-
- /* No quota for this user. */
- if (F.d_blk_softlimit==0 && F.d_blk_hardlimit==0)
- {
- return(False);
- }
-
- /* Use softlimit to determine disk space, except when it has been exceeded */
- if (
- (F.d_blk_softlimit && F.d_bcount>=F.d_blk_softlimit) ||
- (F.d_blk_hardlimit && F.d_bcount>=F.d_blk_hardlimit) ||
- (F.d_ino_softlimit && F.d_icount>=F.d_ino_softlimit) ||
- (F.d_ino_hardlimit && F.d_icount>=F.d_ino_hardlimit)
- )
- {
- *dfree = 0;
- *dsize = F.d_bcount;
- }
- else
- {
- *dfree = (F.d_blk_softlimit - F.d_bcount);
- *dsize = F.d_blk_softlimit ? F.d_blk_softlimit : F.d_blk_hardlimit;
- }
-
- }
- else
- {
- unbecome_root();
- return(False);
- }
-
- return (True);
-
-}
-
#else
#if AIX