From 9bfab7ec8cfb01f102e8e22b7f94cd772a8b5a00 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 3 Sep 2012 12:20:53 +1000 Subject: s3-smbd: Remove IRIX support from old (pre-sysquotas) code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should be essentially dead code, as while it is possible to disable sysquotas, the sysquotas has since 2003 supported the 4A varient used on IRIX. Andrew Bartlett Signed-off-by: Björn Jacke --- source3/smbd/quotas.c | 129 -------------------------------------------------- 1 file changed, 129 deletions(-) (limited to 'source3/smbd/quotas.c') 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 -#include - -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 -- cgit v1.2.1