[SCM] Samba Shared Repository - branch master updated

Christof Schmitt cs at samba.org
Wed Sep 19 01:57:03 UTC 2018


The branch, master has been updated
       via  8b4ec1c docs: Add gpfs:check_fstype to vfs_gpfs manpage
       via  8453c61 vfs_gpfs: Check for GPFS file system on connect
      from  d0d1eaf gitlab-ci: Correct the ctdb tasks

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


- Log -----------------------------------------------------------------
commit 8b4ec1c26e9f1a29eefff497409847894bfc2369
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Sep 17 17:16:56 2018 -0700

    docs: Add gpfs:check_fstype to vfs_gpfs manpage
    
    Signed-off-by; Christof Schmit <cs at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Christof Schmitt <cs at samba.org>
    Autobuild-Date(master): Wed Sep 19 03:56:47 CEST 2018 on sn-devel-144

commit 8453c61789b4950e3eda4ff50dd12b233359d09b
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Sep 17 17:09:16 2018 -0700

    vfs_gpfs: Check for GPFS file system on connect
    
    The vfs_gpfs modules uses GPFS API calls that only succeed when using
    the module with the GPFS file system. Add an explicit statfs check for
    the file system type on connect, to make it obvious when the file system
    is missing or not mounted. The check can be skipped by setting
    gpfs:check_fstype to 'no'.
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

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

Summary of changes:
 docs-xml/manpages/vfs_gpfs.8.xml | 22 ++++++++++++++++++++++
 source3/modules/vfs_gpfs.c       | 26 ++++++++++++++++++++++++++
 2 files changed, 48 insertions(+)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_gpfs.8.xml b/docs-xml/manpages/vfs_gpfs.8.xml
index 428f48a..15e7bcf 100644
--- a/docs-xml/manpages/vfs_gpfs.8.xml
+++ b/docs-xml/manpages/vfs_gpfs.8.xml
@@ -244,6 +244,28 @@
 		</varlistentry>
 		<varlistentry>
 
+		<term>gpfs:check_fstype = [ yes | no ]</term>
+		<listitem>
+		<para>
+		Check for a mounted GPFS file system on access to a SMB share.
+		</para>
+
+		<itemizedlist>
+		<listitem><para>
+		<command>yes(default)</command> - Check that the SMB share path
+		is on a GPFS file system. Share access will be denied when a
+		different file system is found.
+		</para></listitem>
+		<listitem><para>
+		<command>no</command> - skip check for GPFS file system on SMB
+		share path.
+		</para></listitem>
+		</itemizedlist>
+		</listitem>
+
+		</varlistentry>
+		<varlistentry>
+
 		<term>gpfs:refuse_dacl_protected = [ yes | no ]</term>
 		<listitem>
 		<para>
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 982dc19..3a75efd 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -2078,6 +2078,7 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle,
 {
 	struct gpfs_config_data *config;
 	int ret;
+	bool check_fstype;
 
 	gpfswrap_lib_init(0);
 
@@ -2094,6 +2095,31 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle,
 		return ret;
 	}
 
+	check_fstype = lp_parm_bool(SNUM(handle->conn), "gpfs",
+				    "check_fstype", true);
+
+	if (check_fstype && !IS_IPC(handle->conn)) {
+		const char *connectpath = handle->conn->connectpath;
+		struct statfs buf = { 0 };
+
+		ret = statfs(connectpath, &buf);
+		if (ret != 0) {
+			DBG_ERR("statfs failed for share %s at path %s: %s\n",
+				service, connectpath, strerror(errno));
+			TALLOC_FREE(config);
+			return ret;
+		}
+
+		if (buf.f_type != GPFS_SUPER_MAGIC) {
+			DBG_ERR("SMB share %s, path %s not in GPFS file system."
+				" statfs magic: 0x%lx\n",
+				service, connectpath, buf.f_type);
+			errno = EINVAL;
+			TALLOC_FREE(config);
+			return -1;
+		}
+	}
+
 	ret = smbacl4_get_vfs_params(handle->conn, &config->nfs4_params);
 	if (ret < 0) {
 		TALLOC_FREE(config);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list