[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Sun Mar 11 07:19:05 MDT 2012


The branch, master has been updated
       via  f0bba96 s3: Improve statvfs support
       via  51e7859 waf: Do not use standards.h on darwin
      from  26a0e7a s4 dns: Test deleting records and fix a small bu

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f0bba969d87f0fd5c7d3f1ba001a5c9a754cd7ed
Author: Brad Smith <brad at comstyle.com>
Date:   Sat Mar 10 19:16:06 2012 +0100

    s3: Improve statvfs support
    
    Autobuild-User: Volker Lendecke <vl at samba.org>
    Autobuild-Date: Sun Mar 11 14:18:04 CET 2012 on sn-devel-104

commit 51e785949c5908912a9b0ae903e7c18d898808fc
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Mar 10 10:26:10 2012 +0100

    waf: Do not use standards.h on darwin
    
    We get a nasty warning every time we include that

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

Summary of changes:
 buildtools/wafsamba/wscript   |    7 ++++++-
 source3/modules/vfs_default.c |   12 ++++++------
 source3/smbd/statvfs.c        |   11 ++++++++---
 3 files changed, 20 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 5c5e249..094f9cc 100755
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -350,7 +350,12 @@ def configure(conf):
     conf.CHECK_HEADERS('stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.h',
                        add_headers=True)
     conf.CHECK_HEADERS('strings.h inttypes.h stdint.h unistd.h minix/config.h', add_headers=True)
-    conf.CHECK_HEADERS('ctype.h standards.h stdbool.h stdint.h stdarg.h vararg.h', add_headers=True)
+    conf.CHECK_HEADERS('ctype.h', add_headers=True)
+
+    if sys.platform != 'darwin':
+        conf.CHECK_HEADERS('standards.h', add_headers=True)
+
+    conf.CHECK_HEADERS('stdbool.h stdint.h stdarg.h vararg.h', add_headers=True)
     conf.CHECK_HEADERS('limits.h assert.h')
 
     # see if we need special largefile flags
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index fd0ff0a..1dbd308 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -108,15 +108,15 @@ static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle,
 	connection_struct *conn = handle->conn;
 	uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
 	struct smb_filename *smb_fname_cpath = NULL;
+	struct vfs_statvfs_struct statbuf;
 	NTSTATUS status;
-	int ret = -1;
+	int ret;
 
-#if defined(DARWINOS) || (defined(BSD) && defined(BSD_STATVFS_BSIZE))
-	struct vfs_statvfs_struct statbuf;
 	ZERO_STRUCT(statbuf);
-	sys_statvfs(conn->connectpath, &statbuf);
-	caps = statbuf.FsCapabilities;
-#endif
+	ret = sys_statvfs(conn->connectpath, &statbuf);
+	if (ret == 0) {
+		caps = statbuf.FsCapabilities;
+	}
 
 	*p_ts_res = TIMESTAMP_SET_SECONDS;
 
diff --git a/source3/smbd/statvfs.c b/source3/smbd/statvfs.c
index 1e72a8e..5cefe2d 100644
--- a/source3/smbd/statvfs.c
+++ b/source3/smbd/statvfs.c
@@ -151,12 +151,17 @@ static int linux_statvfs(const char *path, vfs_statvfs_struct *statbuf)
 		statbuf->TotalFileNodes = statvfs_buf.f_files;
 		statbuf->FreeFileNodes = statvfs_buf.f_ffree;
 		statbuf->FsIdentifier = statvfs_buf.f_fsid;
-
-		/* Good defaults for Linux filesystems are case sensitive
-		 * and case preserving.
+		/* Try to extrapolate some of the fs flags into the
+		 * capabilities
 		 */
 		statbuf->FsCapabilities =
 		    FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+#ifdef ST_QUOTA
+		if (statvfs_buf.f_flag & ST_QUOTA)
+			statbuf->FsCapabilities |= FILE_VOLUME_QUOTAS;
+#endif
+		if (statvfs_buf.f_flag & ST_RDONLY)
+			statbuf->FsCapabilities |= FILE_READ_ONLY_VOLUME;
 	}
 	return result;
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list