s3-smbd: Remove IRIX support from old (pre-sysquotas) code
authorAndrew Bartlett <abartlet@samba.org>
Mon, 3 Sep 2012 02:20:53 +0000 (12:20 +1000)
committerBjoern Jacke <bj@sernet.de>
Thu, 6 Sep 2012 07:08:57 +0000 (09:08 +0200)
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>
source3/smbd/quotas.c

index 77abb59d98ee0e0acad4427e840d1a06e957a4e1..ec7c63c86dfe821fb203f434bafd0b591a577283 100644 (file)
@@ -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