summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-10-13 05:22:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:26 -0500
commit0c72a09e7d9f3ce06befe76b102cb6361d9382a4 (patch)
tree142f4da97aa8a9fcbe23ae13e38d8deb906bc326
parenta0c84f1b12ce8d4fc9e55c70fd7ad8cc0bb34dcb (diff)
downloadsamba-0c72a09e7d9f3ce06befe76b102cb6361d9382a4.tar.gz
samba-0c72a09e7d9f3ce06befe76b102cb6361d9382a4.tar.bz2
samba-0c72a09e7d9f3ce06befe76b102cb6361d9382a4.zip
r19260: Fix for bug #3524 from tiamat@komi.mts.ru - Solaris quotas.
Jeremy. (This used to be commit ac510a90f3adf72b64a8e2a764b0500dcd223b3f)
-rw-r--r--source3/smbd/quotas.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 35bb94bcef..bb88957731 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -586,7 +586,6 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
int file;
static struct mnttab mnt;
static pstring name;
- pstring devopt;
#else /* SunOS4 */
struct mntent *mnt;
static pstring name;
@@ -603,7 +602,8 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
return(False) ;
devno = sbuf.st_dev ;
- DEBUG(5,("disk_quotas: looking for path \"%s\" devno=%x\n", path,(unsigned int)devno));
+ DEBUG(5,("disk_quotas: looking for path \"%s\" devno=%x\n",
+ path, (unsigned int)devno));
if ( devno != devno_cached ) {
devno_cached = devno ;
#if defined(SUNOS5)
@@ -611,17 +611,19 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
return(False) ;
found = False ;
- slprintf(devopt, sizeof(devopt) - 1, "dev=%x", (unsigned int)devno);
+
while (getmntent(fd, &mnt) == 0) {
- if( !hasmntopt(&mnt, devopt) )
+ if (sys_stat(mnt.mnt_mountp, &sbuf) == -1)
continue;
- DEBUG(5,("disk_quotas: testing \"%s\" %s\n", mnt.mnt_mountp,devopt));
+ DEBUG(5,("disk_quotas: testing \"%s\" devno=%x\n",
+ mnt.mnt_mountp, (unsigned int)devno));
/* quotas are only on vxfs, UFS or NFS */
- if ( strcmp( mnt.mnt_fstype, MNTTYPE_UFS ) == 0 ||
+ if ( (sbuf.st_dev == devno) && (
+ strcmp( mnt.mnt_fstype, MNTTYPE_UFS ) == 0 ||
strcmp( mnt.mnt_fstype, "nfs" ) == 0 ||
- strcmp( mnt.mnt_fstype, "vxfs" ) == 0 ) {
+ strcmp( mnt.mnt_fstype, "vxfs" ) == 0 )) {
found = True ;
break;
}