svn commit: samba r19260 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_23/source/smbd

jra at samba.org jra at samba.org
Fri Oct 13 05:22:37 GMT 2006


Author: jra
Date: 2006-10-13 05:22:36 +0000 (Fri, 13 Oct 2006)
New Revision: 19260

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=19260

Log:
Fix for bug #3524 from tiamat at komi.mts.ru - Solaris quotas.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/quotas.c
   branches/SAMBA_3_0_23/source/smbd/quotas.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/quotas.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/quotas.c	2006-10-13 02:49:16 UTC (rev 19259)
+++ branches/SAMBA_3_0/source/smbd/quotas.c	2006-10-13 05:22:36 UTC (rev 19260)
@@ -586,7 +586,6 @@
 	int file;
 	static struct mnttab mnt;
 	static pstring name;
-	pstring devopt;
 #else /* SunOS4 */
 	struct mntent *mnt;
 	static pstring name;
@@ -603,7 +602,8 @@
 		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 @@
 			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;
 			}

Modified: branches/SAMBA_3_0_23/source/smbd/quotas.c
===================================================================
--- branches/SAMBA_3_0_23/source/smbd/quotas.c	2006-10-13 02:49:16 UTC (rev 19259)
+++ branches/SAMBA_3_0_23/source/smbd/quotas.c	2006-10-13 05:22:36 UTC (rev 19260)
@@ -587,7 +587,6 @@
 	int file;
 	static struct mnttab mnt;
 	static pstring name;
-	pstring devopt;
 #else /* SunOS4 */
 	struct mntent *mnt;
 	static pstring name;
@@ -604,7 +603,8 @@
 		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)
@@ -612,17 +612,19 @@
 			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;
 			}



More information about the samba-cvs mailing list