From 8e99021e65f2d358b2ffc89e31bc2499c9b74690 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 27 Feb 2001 21:46:01 +0000 Subject: Fixes from Toomas Soome code unicode problems, plus a solaris quota update fix. Jeremy. (This used to be commit 9efd7a778b7b172d76af922c3dda8ec31d74bd7d) --- source3/smbd/quotas.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c index 9bbc027cf7..7808d269f9 100644 --- a/source3/smbd/quotas.c +++ b/source3/smbd/quotas.c @@ -244,6 +244,7 @@ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_U #if defined(SUNOS5) #include #include +#include #else /* defined(SUNOS4) */ #include #include @@ -264,6 +265,7 @@ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_U int file; static struct mnttab mnt; static pstring name; + pstring devopt; #else /* SunOS4 */ struct mntent *mnt; static pstring name; @@ -272,7 +274,7 @@ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_U SMB_STRUCT_STAT sbuf; SMB_DEV_T devno ; static SMB_DEV_T devno_cached = 0 ; - int found ; + static int found ; euser_id = geteuid(); @@ -280,7 +282,7 @@ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_U return(False) ; devno = sbuf.st_dev ; - DEBUG(5,("disk_quotas: looking for path \"%s\" devno=%o\n", path,devno)); + DEBUG(5,("disk_quotas: looking for path \"%s\" devno=%x\n", path,devno)); if ( devno != devno_cached ) { devno_cached = devno ; #if defined(SUNOS5) @@ -288,12 +290,17 @@ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_U return(False) ; found = False ; + slprintf(devopt, sizeof(devopt) - 1, "dev=%x", devno); while (getmntent(fd, &mnt) == 0) { - if ( sys_stat(mnt.mnt_mountp,&sbuf) == -1 ) - continue ; - DEBUG(5,("disk_quotas: testing \"%s\" devno=%o\n", - mnt.mnt_mountp,sbuf.st_dev)); - if (sbuf.st_dev == devno) { + if( !hasmntopt(&mnt, devopt) ) + continue; + + DEBUG(5,("disk_quotas: testing \"%s\" %s\n", mnt.mnt_mountp,devopt)); + + /* quotas are only on vxfs, UFS or NFS, but nfs is not supported here */ + if ( strcmp( mnt.mnt_fstype, MNTTYPE_UFS ) == 0 || + strcmp( mnt.mnt_fstype, "vxfs" ) == 0 ) + { found = True ; break ; } @@ -322,10 +329,11 @@ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_U endmntent(fd) ; #endif - if ( ! found ) - return(False) ; } + if ( ! found ) + return(False) ; + save_re_uid(); set_effective_uid(0); -- cgit