diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-09-03 12:20:53 +1000 |
---|---|---|
committer | Bjoern Jacke <bj@sernet.de> | 2012-09-06 09:08:57 +0200 |
commit | 9bfab7ec8cfb01f102e8e22b7f94cd772a8b5a00 (patch) | |
tree | 7a1be11109c3229a583c2f369a98fdbcb3cd9287 /source3 | |
parent | 79bc9e5ace576e67ec14132b9b0c892c642cc98f (diff) | |
download | samba-9bfab7ec8cfb01f102e8e22b7f94cd772a8b5a00.tar.gz samba-9bfab7ec8cfb01f102e8e22b7f94cd772a8b5a00.tar.bz2 samba-9bfab7ec8cfb01f102e8e22b7f94cd772a8b5a00.zip |
s3-smbd: Remove IRIX support from old (pre-sysquotas) code
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 <bj@sernet.de>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/quotas.c | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c index 77abb59d98..ec7c63c86d 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 |