Ignore:
Timestamp:
Apr 10, 2007, 5:27:38 AM (14 years ago)
Author:
Paul Smedley
Message:

Updated source to 3.0.25rc1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/smbd/quotas.c

    r1 r26  
    239239                return(False);
    240240
    241         become_root_uid_only();
     241        become_root();
    242242
    243243        if (strcmp(mnt->mnt_type, "xfs")==0) {
     
    252252        }
    253253
    254         unbecome_root_uid_only();
     254        unbecome_root();
    255255
    256256        /* Use softlimit to determine disk space, except when it has been exceeded */
     
    656656                return(False) ;
    657657
    658         become_root_uid_only();
     658        become_root();
    659659
    660660#if defined(SUNOS5)
     
    663663                DEBUG(5,("disk_quotas: looking for mountpath (NFS) \"%s\"\n", mnt.mnt_special));
    664664                retval = nfs_quotas(mnt.mnt_special, euser_id, bsize, dfree, dsize);
    665                 unbecome_root_uid_only();
     665                unbecome();
    666666                return retval;
    667667        }
     
    669669        DEBUG(5,("disk_quotas: looking for quotas file \"%s\"\n", name));
    670670        if((file=sys_open(name, O_RDONLY,0))<0) {
    671                 unbecome_root_uid_only();
     671                unbecome_root();
    672672                return(False);
    673673        }
     
    682682#endif
    683683
    684         unbecome_root_uid_only();
     684        unbecome_root();
    685685
    686686        if (ret < 0) {
     
    842842
    843843  euser_id=geteuid();
    844   become_root_uid_only();
     844  become_root();
    845845
    846846  /* Use softlimit to determine disk space, except when it has been exceeded */
     
    852852    r=quotactl (Q_GETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &D);
    853853
    854     unbecome_root_uid_only();
     854    unbecome_root();
    855855
    856856    if (r==-1)
     
    883883    r=quotactl (Q_XGETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &F);
    884884
    885     unbecome_root_uid_only();
     885    unbecome_root();
    886886
    887887    if (r==-1)
     
    917917  else
    918918  {
    919           unbecome_root_uid_only();
     919          unbecome_root();
    920920          return(False);
    921921  }
     
    937937#define dqb_fhardlimit dqb_ihardlimit
    938938#define dqb_fsoftlimit dqb_isoftlimit
     939#ifdef _AIXVERSION_530
     940#include <sys/statfs.h>
     941#include <sys/vmount.h>
     942#endif /* AIX 5.3 */
    939943#else /* !__FreeBSD__ && !AIX && !__OpenBSD__ && !__DragonFly__ */
    940944#include <sys/quota.h>
     
    11811185#endif
    11821186   
    1183     become_root_uid_only();
     1187    become_root();
    11841188
    11851189#if defined(__FreeBSD__) || defined(__DragonFly__)
     
    11871191        BOOL retval;
    11881192        retval = nfs_quotas(mnts[i].f_mntfromname,euser_id,bsize,dfree,dsize);
    1189         unbecome_root_uid_only();
     1193        unbecome_root();
    11901194        return retval;
    11911195    }
     
    12011205    }
    12021206
    1203     unbecome_root_uid_only();
     1207    unbecome_root();
    12041208  }
    12051209#elif defined(AIX)
    12061210  /* AIX has both USER and GROUP quotas:
    12071211     Get the USER quota (ohnielse@fysik.dtu.dk) */
     1212#ifdef _AIXVERSION_530
     1213  {
     1214    struct statfs statbuf;
     1215    quota64_t user_quota;
     1216    if (statfs(path,&statbuf) != 0)
     1217      return False;
     1218    if(statbuf.f_vfstype == MNT_J2)
     1219    {
     1220    /* For some reason we need to be root for jfs2 */
     1221      become_root();
     1222      r = quotactl(path,QCMD(Q_J2GETQUOTA,USRQUOTA),euser_id,(char *) &user_quota);
     1223      unbecome_root();
     1224    /* Copy results to old struct to let the following code work as before */
     1225      D.dqb_curblocks  = user_quota.bused;
     1226      D.dqb_bsoftlimit = user_quota.bsoft;
     1227      D.dqb_bhardlimit = user_quota.bhard;
     1228    }
     1229    else if(statbuf.f_vfstype == MNT_JFS)
     1230    {
     1231#endif /* AIX 5.3 */
    12081232  save_re_uid();
    12091233  if (set_re_uid() != 0)
     
    12111235  r= quotactl(path,QCMD(Q_GETQUOTA,USRQUOTA),euser_id,(char *) &D);
    12121236  restore_re_uid();
     1237#ifdef _AIXVERSION_530
     1238    }
     1239    else
     1240      r = 1; /* Fail for other FS-types */
     1241  }
     1242#endif /* AIX 5.3 */
    12131243#else /* !__FreeBSD__ && !AIX && !__OpenBSD__ && !__DragonFly__ */
    12141244  r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);
Note: See TracChangeset for help on using the changeset viewer.