[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Fri Mar 3 01:24:03 UTC 2017


The branch, master has been updated
       via  1e0c79d s3: smbd: Restart reading the incoming SMB2 fd when the send queue is drained.
       via  07af777 selftest: remove "ea support" from vfs_fruit-related setups.
       via  cbab5c6 vfs_fruit: drop "ea support" from the manpage
       via  5ef7bd3 testparm: remove check for "ea support" in fruit shares
       via  4bfd27b smbd: remove coupling between get_ea_names_from_file() and "ea support"
       via  fb95985 smbd: get_ea_list_from_file_path() - remove a duplicate statement
       via  abd8450 smbd: refuse_symlink() - do not fail if the file does not exist
      from  f9aaddc s3:winbindd: fix endless forest trust scan

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


- Log -----------------------------------------------------------------
commit 1e0c79ddb34be9a2b9fa92d35387c443c4a381ae
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Mar 2 09:13:23 2017 -0800

    s3: smbd: Restart reading the incoming SMB2 fd when the send queue is drained.
    
    When the send queue grows greater than xconn->smb2.credits.max/16,
    smbd_smb2_request_next_incoming() doesn't allocate a new request in state->req.
    
    After smbd_smb2_io_handler() is called, it marks the fd not readable as
    state->req == NULL, and never marks it readable again.
    
    Fix by calling smbd_smb2_request_next_incoming() to restart
    reads inside smbd_smb2_flush_send_queue() which drains the
    send queue.
    
    Reported by <chen.yehua at h3c.com>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12608
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Fri Mar  3 02:23:20 CET 2017 on sn-devel-144

commit 07af7774f3bd3574be0632284a6ea220b5fb3c76
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Mar 2 13:02:25 2017 +0200

    selftest: remove "ea support" from vfs_fruit-related setups.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit cbab5c64966cafbfdc6dfe539b3d1c7ba21a4aae
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Mar 2 12:59:16 2017 +0200

    vfs_fruit: drop "ea support" from the manpage
    
    Now that ea support is not required, drop that
    comment from the man page.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 5ef7bd3b5b078702a9ef8ad92768c2d11b3214f5
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Mar 2 12:56:25 2017 +0200

    testparm: remove check for "ea support" in fruit shares
    
    Now that ea support is not required for vfs_fruit, drop the
    check that it's enabled in shares using vfs_fruit.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 4bfd27b077f0932c82cfe702bd4ba6628f75a526
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Mar 2 08:39:56 2017 +0200

    smbd: remove coupling between get_ea_names_from_file() and "ea support"
    
    The "ea support" configuration variable determines whether smbd
    should attempt to manipulate extended attributes via SMB protocol.
    It does not pertain to the underlying storage and its support for
    extended attributes.
    
    get_ea_names_from_file() is being used also by vfs_streams_xattr -
    a module which has nothing to do with client-visible extended
    attributes. As such, vfs_streams_xattr should be able to operate
    irrespective of the value of "ea support".
    
    This patch moves the check for ea support to the callers.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit fb95985a0325c660dd964b4132e292b9230ee097
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Mar 2 08:49:54 2017 +0200

    smbd: get_ea_list_from_file_path() - remove a duplicate statement
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit abd845082e4d377231129339d713e1b62a88a8a7
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Mar 2 08:46:44 2017 +0200

    smbd: refuse_symlink() - do not fail if the file does not exist
    
    If the file does not exist, it is not a symlink. Current callers
    use this function to see if extended attributes can be set / fetched.
    Allow them to try and leave the error code at the discretion of the
    VFS.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

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

Summary of changes:
 docs-xml/manpages/vfs_fruit.8.xml |  3 ---
 selftest/target/Samba3.pm         |  5 -----
 source3/smbd/nttrans.c            | 30 ++++++++++++++++++------------
 source3/smbd/smb2_server.c        | 14 +++++++++++++-
 source3/smbd/trans2.c             | 14 ++++++++------
 source3/utils/testparm.c          |  6 ------
 6 files changed, 39 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml
index d209a22..fbe30d3 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -45,8 +45,6 @@
 	<command>vfs_streams_xattr</command> which must be loaded
 	together with <command>vfs_fruit</command>.</para>
 
-	<para>vfs_fruit requires "ea support = yes".</para>
-
 	<para>Be careful when mixing shares with and without
 	vfs_fruit. OS X clients negotiate SMB2 AAPL protocol
 	extensions on the first tcon, so mixing shares with and
@@ -273,7 +271,6 @@
 
 <programlisting>
         <smbconfsection name="[share]"/>
-	<smbconfoption name="ea support">yes</smbconfoption>
 	<smbconfoption name="vfs objects">catia fruit streams_xattr</smbconfoption>
 	<smbconfoption name="fruit:resource">file</smbconfoption>
 	<smbconfoption name="fruit:metadata">netatalk</smbconfoption>
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index aa50f07..775dc16 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -1654,7 +1654,6 @@ sub provision($$$$$$$$)
 [vfs_fruit]
 	path = $shrdir
 	vfs objects = catia fruit streams_xattr acl_xattr
-	ea support = yes
 	fruit:resource = file
 	fruit:metadata = netatalk
 	fruit:locking = netatalk
@@ -1663,26 +1662,22 @@ sub provision($$$$$$$$)
 [vfs_fruit_metadata_stream]
 	path = $shrdir
 	vfs objects = fruit streams_xattr acl_xattr
-	ea support = yes
 	fruit:resource = file
 	fruit:metadata = stream
 
 [vfs_fruit_stream_depot]
 	path = $shrdir
 	vfs objects = fruit streams_depot acl_xattr
-	ea support = yes
 	fruit:resource = stream
 	fruit:metadata = stream
 
 [vfs_wo_fruit]
 	path = $shrdir
 	vfs objects = streams_xattr acl_xattr
-	ea support = yes
 
 [vfs_wo_fruit_stream_depot]
 	path = $shrdir
 	vfs objects = streams_depot acl_xattr
-	ea support = yes
 
 [badname-tmp]
 	path = $badnames_shrdir
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 5f122a9..a5fc625 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -688,16 +688,19 @@ void reply_ntcreate_and_X(struct smb_request *req)
 	p += 8;
 	if (flags & EXTENDED_RESPONSE_REQUIRED) {
 		uint16_t file_status = (NO_EAS|NO_SUBSTREAMS|NO_REPARSETAG);
-		size_t num_names = 0;
 		unsigned int num_streams = 0;
 		struct stream_struct *streams = NULL;
 
-		/* Do we have any EA's ? */
-		status = get_ea_names_from_file(ctx, conn, fsp,
-				smb_fname, NULL, &num_names);
-		if (NT_STATUS_IS_OK(status) && num_names) {
-			file_status &= ~NO_EAS;
+		if (lp_ea_support(SNUM(conn))) {
+			size_t num_names = 0;
+			/* Do we have any EA's ? */
+			status = get_ea_names_from_file(
+			    ctx, conn, fsp, smb_fname, NULL, &num_names);
+			if (NT_STATUS_IS_OK(status) && num_names) {
+				file_status &= ~NO_EAS;
+			}
 		}
+
 		status = vfs_streaminfo(conn, NULL, smb_fname, ctx,
 			&num_streams, &streams);
 		/* There is always one stream, ::$DATA. */
@@ -1334,16 +1337,19 @@ static void call_nt_transact_create(connection_struct *conn,
 	p += 8;
 	if (flags & EXTENDED_RESPONSE_REQUIRED) {
 		uint16_t file_status = (NO_EAS|NO_SUBSTREAMS|NO_REPARSETAG);
-		size_t num_names = 0;
 		unsigned int num_streams = 0;
 		struct stream_struct *streams = NULL;
 
-		/* Do we have any EA's ? */
-		status = get_ea_names_from_file(ctx, conn, fsp,
-				smb_fname, NULL, &num_names);
-		if (NT_STATUS_IS_OK(status) && num_names) {
-			file_status &= ~NO_EAS;
+		if (lp_ea_support(SNUM(conn))) {
+			size_t num_names = 0;
+			/* Do we have any EA's ? */
+			status = get_ea_names_from_file(
+			    ctx, conn, fsp, smb_fname, NULL, &num_names);
+			if (NT_STATUS_IS_OK(status) && num_names) {
+				file_status &= ~NO_EAS;
+			}
 		}
+
 		status = vfs_streaminfo(conn, NULL, smb_fname, ctx,
 			&num_streams, &streams);
 		/* There is always one stream, ::$DATA. */
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index b0a4afc..acaa012 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -3566,6 +3566,7 @@ static NTSTATUS smbd_smb2_flush_send_queue(struct smbXsrv_connection *xconn)
 	int ret;
 	int err;
 	bool retry;
+	NTSTATUS status;
 
 	if (xconn->smb2.send_queue == NULL) {
 		TEVENT_FD_NOT_WRITEABLE(xconn->transport.fde);
@@ -3577,11 +3578,12 @@ static NTSTATUS smbd_smb2_flush_send_queue(struct smbXsrv_connection *xconn)
 		bool ok;
 
 		if (e->sendfile_header != NULL) {
-			NTSTATUS status = NT_STATUS_INTERNAL_ERROR;
 			size_t size = 0;
 			size_t i = 0;
 			uint8_t *buf;
 
+			status = NT_STATUS_INTERNAL_ERROR;
+
 			for (i=0; i < e->count; i++) {
 				size += e->vector[i].iov_len;
 			}
@@ -3653,6 +3655,16 @@ static NTSTATUS smbd_smb2_flush_send_queue(struct smbXsrv_connection *xconn)
 		talloc_free(e->mem_ctx);
 	}
 
+	/*
+	 * Restart reads if we were blocked on
+	 * draining the send queue.
+	 */
+
+	status = smbd_smb2_request_next_incoming(xconn);
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
+	}
+
 	return NT_STATUS_OK;
 }
 
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index f58aacf..b6bf93f 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -75,8 +75,11 @@ static NTSTATUS refuse_symlink(connection_struct *conn,
 		int ret = vfs_stat_smb_basename(conn,
 				smb_fname,
 				&sbuf);
-		if (ret == -1) {
+		if (ret == -1 && errno != ENOENT) {
 			return map_nt_error_from_unix(errno);
+		} else if (ret == -1) {
+			/* it's not a symlink.. */
+			return NT_STATUS_OK;
 		}
 		pst = &sbuf;
 	}
@@ -259,10 +262,6 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx,
 	}
 	*pnum_names = 0;
 
-	if (!lp_ea_support(SNUM(conn))) {
-		return NT_STATUS_OK;
-	}
-
 	status = refuse_symlink(conn, fsp, smb_fname);
 	if (!NT_STATUS_IS_OK(status)) {
 		/*
@@ -394,6 +393,10 @@ static NTSTATUS get_ea_list_from_file_path(TALLOC_CTX *mem_ctx,
 	*pea_total_len = 0;
 	*ea_list = NULL;
 
+	if (!lp_ea_support(SNUM(conn))) {
+		return NT_STATUS_OK;
+	}
+
 	if (fsp) {
 		posix_pathnames =
 			(fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH);
@@ -413,7 +416,6 @@ static NTSTATUS get_ea_list_from_file_path(TALLOC_CTX *mem_ctx,
 	}
 
 	if (num_names == 0) {
-		*ea_list = NULL;
 		return NT_STATUS_OK;
 	}
 
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index 3e80c39..7883bca 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -606,12 +606,6 @@ static void do_per_share_checks(int s)
 	vfs_objects = lp_vfs_objects(s);
 	if (vfs_objects && str_list_check(vfs_objects, "fruit")) {
 		uses_fruit = true;
-		if (!lp_ea_support(s) && !lp_ea_support(-1)) {
-			fprintf(stderr,
-				"ERROR: Service \"%s\" uses vfs_fruit, but "
-				"that requires \"ea support = yes\".\n\n",
-				lp_servicename(talloc_tos(), s));
-		}
 	} else {
 		doesnt_use_fruit = true;
 	}


-- 
Samba Shared Repository



More information about the samba-cvs mailing list