summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-05 23:56:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:11 -0500
commitbc45c82904e268327bfbf72cd3f35699ae6e7397 (patch)
tree1ff4f7e3d1befc81659a01f1dedf72756ff020a6 /source3/smbd
parent90dc2613153bb8c865a1cfda0318ae4db3cf212e (diff)
downloadsamba-bc45c82904e268327bfbf72cd3f35699ae6e7397.tar.gz
samba-bc45c82904e268327bfbf72cd3f35699ae6e7397.tar.bz2
samba-bc45c82904e268327bfbf72cd3f35699ae6e7397.zip
r22096: become_root_uid_only() is unneeded - it's only used in
messages.c. Refactor to use become_root() instead and make it local to messages.c Jeremy. (This used to be commit f3ffb3f98472b69b476b702dfe5c0575b32da018)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/quotas.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 0492130950..ddfcb8e0f8 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -238,7 +238,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
if (!found)
return(False);
- become_root_uid_only();
+ become_root();
if (strcmp(mnt->mnt_type, "xfs")==0) {
r=get_smb_linux_xfs_quota(mnt->mnt_fsname, euser_id, egrp_id, &D);
@@ -251,7 +251,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
}
}
- unbecome_root_uid_only();
+ unbecome_root();
/* Use softlimit to determine disk space, except when it has been exceeded */
*bsize = D.bsize;
@@ -655,20 +655,20 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
if ( ! found )
return(False) ;
- become_root_uid_only();
+ become_root();
#if defined(SUNOS5)
if ( strcmp( mnt.mnt_fstype, "nfs" ) == 0) {
BOOL retval;
DEBUG(5,("disk_quotas: looking for mountpath (NFS) \"%s\"\n", mnt.mnt_special));
retval = nfs_quotas(mnt.mnt_special, euser_id, bsize, dfree, dsize);
- unbecome_root_uid_only();
+ unbecome();
return retval;
}
DEBUG(5,("disk_quotas: looking for quotas file \"%s\"\n", name));
if((file=sys_open(name, O_RDONLY,0))<0) {
- unbecome_root_uid_only();
+ unbecome_root();
return(False);
}
command.op = Q_GETQUOTA;
@@ -681,7 +681,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
ret = quotactl(Q_GETQUOTA, name, euser_id, &D);
#endif
- unbecome_root_uid_only();
+ unbecome_root();
if (ret < 0) {
DEBUG(5,("disk_quotas ioctl (Solaris) failed. Error = %s\n", strerror(errno) ));
@@ -841,7 +841,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
}
euser_id=geteuid();
- become_root_uid_only();
+ become_root();
/* Use softlimit to determine disk space, except when it has been exceeded */
@@ -851,7 +851,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
{
r=quotactl (Q_GETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &D);
- unbecome_root_uid_only();
+ unbecome_root();
if (r==-1)
return(False);
@@ -882,7 +882,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
{
r=quotactl (Q_XGETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &F);
- unbecome_root_uid_only();
+ unbecome_root();
if (r==-1)
{
@@ -916,7 +916,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
}
else
{
- unbecome_root_uid_only();
+ unbecome_root();
return(False);
}
@@ -1184,13 +1184,13 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
return False;
#endif
- become_root_uid_only();
+ become_root();
#if defined(__FreeBSD__) || defined(__DragonFly__)
if (strcmp(mnts[i].f_fstypename,"nfs") == 0) {
BOOL retval;
retval = nfs_quotas(mnts[i].f_mntfromname,euser_id,bsize,dfree,dsize);
- unbecome_root_uid_only();
+ unbecome_root();
return retval;
}
#endif
@@ -1204,7 +1204,7 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
r= quotactl(path,QCMD(Q_GETQUOTA,GRPQUOTA),egrp_id,(char *) &D);
}
- unbecome_root_uid_only();
+ unbecome_root();
}
#elif defined(AIX)
/* AIX has both USER and GROUP quotas:
@@ -1218,9 +1218,9 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
if(statbuf.f_vfstype == MNT_J2)
{
/* For some reason we need to be root for jfs2 */
- become_root_uid_only();
+ become_root();
r = quotactl(path,QCMD(Q_J2GETQUOTA,USRQUOTA),euser_id,(char *) &user_quota);
- unbecome_root_uid_only();
+ unbecome_root();
/* Copy results to old struct to let the following code work as before */
D.dqb_curblocks = user_quota.bused;
D.dqb_bsoftlimit = user_quota.bsoft;