[SCM] Samba Shared Repository - branch v3-6-test updated

Karolin Seeger kseeger at samba.org
Fri Mar 2 12:32:15 MST 2012


The branch, v3-6-test has been updated
       via  14fe979 Revert "s3: Add sys_statvfs() wrapper support for OpenBSD/FreeBSD/DragonFly."
      from  5278f1c Fix problem reported by Tom Lee <tlee2951 at gmail.com> - when calculating the share security mask, take priviliges into account for the connecting user.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit 14fe979a32c94ebd88a934bcfaef3cb754e3c04c
Author: Karolin Seeger <kseeger at samba.org>
Date:   Fri Mar 2 20:29:58 2012 +0100

    Revert "s3: Add sys_statvfs() wrapper support for OpenBSD/FreeBSD/DragonFly."
    
    This reverts commit a0d51949abde68134eb35150d797387a1fb57ab7.
    
    https://bugzilla.samba.org/show_bug.cgi?id=8777
    
    --- Comment #9 from Volker Lendecke <vl at samba.org> 2012-03-02 00:32:41 UTC ---
    Karolin, would it be possible that you revert
    a0d51949abde68134eb35150d797387a1fb57ab7 from v3-6-test? I did test this on
    FreeBSD, but it makes the build fail on NetBSD. This patch needs to grow a bit
    in master and is not ready for 3.6.
    
    [...]
    
    Volker

-----------------------------------------------------------------------

Summary of changes:
 source3/configure.in          |   10 +--------
 source3/modules/vfs_default.c |    2 +-
 source3/smbd/statvfs.c        |   43 ++--------------------------------------
 3 files changed, 5 insertions(+), 50 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index 67e08c1..d8d3a1f 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -6754,21 +6754,13 @@ CFLAGS=$CFLAGS_SAVE
 # Start
 AC_CHECK_FUNC(getmntent)
 
-AC_CHECK_HEADERS(sys/param.h sys/statfs.h sys/mount.h)
+AC_CHECK_HEADERS(sys/statfs.h)
 
 AC_MSG_CHECKING([vfs_fileid: checking for statfs() and struct statfs.f_fsid)])
 AC_CACHE_VAL(vfsfileid_cv_statfs,[
 	     AC_TRY_RUN([
 		#include <sys/types.h>
-		#ifdef HAVE_SYS_PARAM_H
-		#include <sys/param.h>
-		#endif
-		#ifdef HAVE_SYS_MOUNT_H
-		#include <sys/mount.h>
-		#endif
-		#ifdef HAVE_SYS_STATFS_H
 		#include <sys/statfs.h>
-		#endif
 		int main(void)
 		{
 			struct statfs fsd;
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 8a31d23..27e9b9b 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -107,7 +107,7 @@ static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle,
 	NTSTATUS status;
 	int ret = -1;
 
-#if defined(DARWINOS) || (defined(BSD) && defined(MNT_RDONLY))
+#if defined(DARWINOS)
 	struct vfs_statvfs_struct statbuf;
 	ZERO_STRUCT(statbuf);
 	sys_statvfs(conn->connectpath, &statbuf);
diff --git a/source3/smbd/statvfs.c b/source3/smbd/statvfs.c
index bcdcd91..2de015a 100644
--- a/source3/smbd/statvfs.c
+++ b/source3/smbd/statvfs.c
@@ -49,7 +49,9 @@ static int linux_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 	}
 	return result;
 }
-#elif defined(DARWINOS)
+#endif
+
+#if defined(DARWINOS)
 
 #include <sys/attr.h>
 
@@ -123,43 +125,6 @@ static int darwin_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 
 	return 0;
 }
-#elif defined(BSD) && defined(MNT_RDONLY)
-static int bsd_statvfs(const char *path, vfs_statvfs_struct *statbuf)
-{
-	struct statfs statfs_buf;
-	int result;
-
-	result = statfs(path, &statfs_buf);
-	if (result != 0) {
-		return result;
-	}
-
-	statbuf->OptimalTransferSize = statfs_buf.f_iosize;
-	statbuf->BlockSize = statfs_buf.f_bsize;
-	statbuf->TotalBlocks = statfs_buf.f_blocks;
-	statbuf->BlocksAvail = statfs_buf.f_bfree;
-	statbuf->UserBlocksAvail = statfs_buf.f_bavail;
-	statbuf->TotalFileNodes = statfs_buf.f_files;
-	statbuf->FreeFileNodes = statfs_buf.f_ffree;
-	statbuf->FsIdentifier =
-		(((uint64_t) statfs_buf.f_fsid.val[0] << 32) & 0xffffffff00000000LL) |
-		    (uint64_t) statfs_buf.f_fsid.val[1];
-	/* Try to extrapolate some of the fs flags into the
-	 * capabilities
-	 */
-	statbuf->FsCapabilities =
-	    FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
-#ifdef MNT_ACLS
-	if (statfs_buf.f_flags & MNT_ACLS)
-		statbuf->FsCapabilities |= FILE_PERSISTENT_ACLS;
-#endif
-	if (statfs_buf.f_flags & MNT_QUOTA)
-		statbuf->FsCapabilities |= FILE_VOLUME_QUOTAS;
-	if (statfs_buf.f_flags & MNT_RDONLY)
-		statbuf->FsCapabilities |= FILE_READ_ONLY_VOLUME;
-
-	return 0;
-}
 #endif
 
 /* 
@@ -174,8 +139,6 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 	return linux_statvfs(path, statbuf);
 #elif defined(DARWINOS)
 	return darwin_statvfs(path, statbuf);
-#elif defined(BSD) && defined(MNT_RDONLY)
-	return bsd_statvfs(path, statbuf);
 #else
 	/* BB change this to return invalid level */
 #ifdef EOPNOTSUPP


-- 
Samba Shared Repository


More information about the samba-cvs mailing list