[SCM] Samba Shared Repository - branch v4-10-test updated

Karolin Seeger kseeger at samba.org
Tue Apr 16 14:43:03 UTC 2019


The branch, v4-10-test has been updated
       via  faa61e3c878 docs/vfs_ceph: describe new ACL behaviour
       via  bd3c73e0861 vfs_ceph: explicitly enable libcephfs POSIX ACL support
       via  822df5a6dc1 smb2_server: grant all 8192 credits to clients
       via  d508ec61012 vfs_default: fix vfswrap_offload_write_send() NT_STATUS_INVALID_VIEW_SIZE check
       via  cfdec9a8563 vfs_default: fix DEBUG messages in vfswrap_offload_write_*_done()
       via  5d418910795 vfs_snapper: drop unneeded fstat handler
       via  94b7fcba46e smb2_tcon: avoid STATUS_PENDING completely on tdis
       via  0acd5de3532 smb2_sesssetup: avoid STATUS_PENDING completely on session logoff
       via  3e4d622e296 smb2_tcon: avoid STATUS_PENDING responses for tree connect
       via  914d7c53f4d smb2_sesssetup: avoid STATUS_PENDING responses for session setup
       via  d0f5c69b11a smb2_server: allow smbd_smb2_request_pending_queue(0) to avoid STATUS_PENDING
       via  690ba5dc876 s3:smbd: handle IO_REPARSE_TAG_DFS in SMB_FIND_FILE_FULL_DIRECTORY_INFO
      from  e23fdfe6730 ctdb-common: Avoid race between fd and signal events

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-10-test


- Log -----------------------------------------------------------------
commit faa61e3c87874baa3ca9ad474dfb803e59d13926
Author: David Disseldorp <ddiss at samba.org>
Date:   Fri Apr 12 13:55:50 2019 +0200

    docs/vfs_ceph: describe new ACL behaviour
    
    vfs_ceph now explicitly enables libcephfs POSIX ACL support.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13896
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Apr 12 19:40:25 UTC 2019 on sn-devel-144
    
    (cherry picked from commit 58314d71ea63e36d5f1bbd2c3e190b1edffee726)
    
    Autobuild-User(v4-10-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-10-test): Tue Apr 16 14:42:07 UTC 2019 on sn-devel-144

commit bd3c73e086159ca394b297b751b9337533330ee1
Author: David Disseldorp <ddiss at samba.org>
Date:   Fri Apr 12 13:52:43 2019 +0200

    vfs_ceph: explicitly enable libcephfs POSIX ACL support
    
    libcephfs disables ACL support by default and returns -EOPNOTSUPP in the
    POSIX ACL get/setxattr paths as a result. Enable support by setting the
    following Ceph config parameters during mount:
            client acl type = posix_acl
            fuse default permissions = false
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13896
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 4982e282f2f2246952854ccc10d4787ac6653a7f)

commit 822df5a6dc1cb4e4094924d1b88f1cd751f6e905
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 16 12:24:04 2019 +0100

    smb2_server: grant all 8192 credits to clients
    
    This seems to match Windows Server 2016.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13863
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 829f692fb1552e56c6a9726036a995b4328731dd)

commit d508ec6101226b82ddd334828231bd543c13888b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 31 12:29:29 2018 +0200

    vfs_default: fix vfswrap_offload_write_send() NT_STATUS_INVALID_VIEW_SIZE check
    
    This fixes a regression introduced in commit
    60e45a2d25401eaf9a15a86d19114670ccfde259, where the 'num' variable
    was renamed to 'to_copy', but a new 'num' variable was introduced.
    
    Note that off_t is signed!
    In future we need to watch out for filesystems supporting
    FMODE_UNSIGNED_OFFSET on Linux. Which means they use it unsigned.
    
    This is more or less a theoretical problem, The
    NT_STATUS_INVALID_PARAMETER cases are catched before by
    SMB_VFS_PREAD_SEND/RECV.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13862
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 4d6cd932a955a99ca33cc4aedd7f612e56e0b1de)

commit cfdec9a8563beb95fb939eb1a5650ab0f19e948b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 27 12:43:32 2019 +0100

    vfs_default: fix DEBUG messages in vfswrap_offload_write_*_done()
    
    SMB_VFS_{PREAD,PWRITE}_RECV() don't set errno, so we need to
    use strerror(aio_state.error) in the debug messages.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13862
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2abf9e9a95cbdf76109b3501dee3e0c34ad09194)

commit 5d418910795d0cf88a6815ca732de69e461be0ce
Author: David Disseldorp <ddiss at samba.org>
Date:   Mon Mar 25 18:06:15 2019 +0100

    vfs_snapper: drop unneeded fstat handler
    
    fstat is handle based, and unlike vfs_shadow_copy2, we don't need to
    make any changes to the returned sbuf, so remove the existing handler
    which does nothing.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=13858
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Mar 27 18:21:38 UTC 2019 on sn-devel-144
    
    (cherry picked from commit c68d9c9ef367c1e85619ac2d027a0a425164ca8a)

commit 94b7fcba46eaae9c24e86992e0e99e2144dd1fee
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 12 08:27:43 2019 +0100

    smb2_tcon: avoid STATUS_PENDING completely on tdis
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10344
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13698
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 1dc002548336b969979c3bf85b531c059d87f015)

commit 0acd5de35323ebb7731a58aeded787baf79f1f13
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 12 08:27:43 2019 +0100

    smb2_sesssetup: avoid STATUS_PENDING completely on session logoff
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10344
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13698
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit d64038425f250e253dce707d69899c7a5d8cb32e)

commit 3e4d622e29625fa53fdc5d11faed2e44c76c4e2c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jan 24 09:10:11 2019 +0100

    smb2_tcon: avoid STATUS_PENDING responses for tree connect
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12844
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13698
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 8a11da429bd3c89766f43c2bff681837a769987c)

commit 914d7c53f4da68c42f251b8d5bbea4a113a50519
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jan 24 09:10:11 2019 +0100

    smb2_sesssetup: avoid STATUS_PENDING responses for session setup
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12845
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13698
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13796
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 23792449694b5221f6ea422166c96fac494e3e2c)

commit d0f5c69b11a72fcaf120bae664448001a2f22814
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Feb 12 08:08:38 2019 +0100

    smb2_server: allow smbd_smb2_request_pending_queue(0) to avoid STATUS_PENDING
    
    This has the same meaning as smb2_request_set_async_internal(),
    but this will simplifies callers.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13698
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13796
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 4760b85243f335bb2094fc779802ce4b52db0ccb)

commit 690ba5dc8769dc4fa0106e311c62ee807e857b92
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Oct 9 12:06:29 2017 +0200

    s3:smbd: handle IO_REPARSE_TAG_DFS in SMB_FIND_FILE_FULL_DIRECTORY_INFO
    
    This completes commit 74829fecd7a4e806ee441cd75141bede2eefef1a,
    which missed SMB_FIND_FILE_FULL_DIRECTORY_INFO
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10097
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 1d9348575914891dbb5638bc9b8d51eda98fe554)

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

Summary of changes:
 docs-xml/manpages/vfs_ceph.8.xml | 11 ++++++++++
 selftest/knownfail               |  3 ---
 source3/modules/vfs_ceph.c       | 11 ++++++++++
 source3/modules/vfs_default.c    | 47 +++++++++++++++++++++++++++++++++-------
 source3/modules/vfs_snapper.c    | 19 ----------------
 source3/smbd/smb2_server.c       | 19 +++++++++++-----
 source3/smbd/smb2_sesssetup.c    | 17 +++++++++++----
 source3/smbd/smb2_tcon.c         | 12 ++++++----
 source3/smbd/trans2.c            |  6 +++--
 9 files changed, 99 insertions(+), 46 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_ceph.8.xml b/docs-xml/manpages/vfs_ceph.8.xml
index 453052ebae9..5b32122113a 100644
--- a/docs-xml/manpages/vfs_ceph.8.xml
+++ b/docs-xml/manpages/vfs_ceph.8.xml
@@ -49,6 +49,17 @@
 		list. Modules added to this list to the right of the ceph
 		entry may not have any effect at all.
 	</para>
+
+	<para>
+		<command>vfs_ceph</command> performs mapping between Windows and
+		POSIX Access Control Lists (ACLs). To ensure correct processing
+		and enforcement of POSIX ACLs, the following Ceph configuration
+		parameters are automatically applied:
+	</para>
+	<programlisting>
+		<command>client acl type = posix_acl</command>
+		<command>fuse default permissions = false</command>
+	</programlisting>
 </refsect1>
 
 <refsect1>
diff --git a/selftest/knownfail b/selftest/knownfail
index abbbd889c71..7176e097eb2 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -333,9 +333,6 @@
 ^samba.tests.dcerpc.dnsserver.python2.samba.tests.dcerpc.dnsserver.DnsserverTests.test_add_duplicate_different_type.*
 ^samba.tests.dcerpc.dnsserver.python2.samba.tests.dcerpc.dnsserver.DnsserverTests.test_rank_none.*
 ^samba.tests.dcerpc.dnsserver.python2.samba.tests.dcerpc.dnsserver.DnsserverTests.test_security_descriptor.*
-^samba3.smb2.credits.session_setup_credits_granted.*
-^samba3.smb2.credits.single_req_credits_granted.*
-^samba3.smb2.credits.skipped_mid.*
 ^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.dbcheck_dangling_multi_valued_clean
 ^samba4.blackbox.dbcheck-links.release-4-5-0-pre1.dangling_multi_valued_check_missing
 #
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index 113fff696a8..190bda8228f 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -119,6 +119,17 @@ static int cephwrap_connect(struct vfs_handle_struct *handle,  const char *servi
 		goto err_cm_release;
 	}
 
+	/* libcephfs disables POSIX ACL support by default, enable it... */
+	ret = ceph_conf_set(cmount, "client_acl_type", "posix_acl");
+	if (ret < 0) {
+		goto err_cm_release;
+	}
+	/* tell libcephfs to perform local permission checks */
+	ret = ceph_conf_set(cmount, "fuse_default_permissions", "false");
+	if (ret < 0) {
+		goto err_cm_release;
+	}
+
 	DBG_DEBUG("[CEPH] calling: ceph_mount\n");
 	ret = ceph_mount(cmount, NULL);
 	if (ret < 0) {
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index cb5537e096e..bf6b303bac6 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1803,6 +1803,8 @@ static struct tevent_req *vfswrap_offload_write_send(
 {
 	struct tevent_req *req;
 	struct vfswrap_offload_write_state *state = NULL;
+	/* off_t is signed! */
+	off_t max_offset = INT64_MAX - to_copy;
 	size_t num = MIN(to_copy, COPYCHUNK_MAX_TOTAL_LEN);
 	files_struct *src_fsp = NULL;
 	NTSTATUS status;
@@ -1854,6 +1856,35 @@ static struct tevent_req *vfswrap_offload_write_send(
 		return tevent_req_post(req, ev);
 	}
 
+	if (state->src_off > max_offset) {
+		/*
+		 * Protect integer checks below.
+		 */
+		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+		return tevent_req_post(req, ev);
+	}
+	if (state->src_off < 0) {
+		/*
+		 * Protect integer checks below.
+		 */
+		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+		return tevent_req_post(req, ev);
+	}
+	if (state->dst_off > max_offset) {
+		/*
+		 * Protect integer checks below.
+		 */
+		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+		return tevent_req_post(req, ev);
+	}
+	if (state->dst_off < 0) {
+		/*
+		 * Protect integer checks below.
+		 */
+		tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+		return tevent_req_post(req, ev);
+	}
+
 	status = vfs_offload_token_db_fetch_fsp(vfswrap_offload_ctx,
 						token, &src_fsp);
 	if (tevent_req_nterror(req, status)) {
@@ -1877,17 +1908,12 @@ static struct tevent_req *vfswrap_offload_write_send(
 	state->src_ev = src_fsp->conn->sconn->ev_ctx;
 	state->src_fsp = src_fsp;
 
-	state->buf = talloc_array(state, uint8_t, num);
-	if (tevent_req_nomem(state->buf, req)) {
-		return tevent_req_post(req, ev);
-	}
-
 	status = vfs_stat_fsp(src_fsp);
 	if (tevent_req_nterror(req, status)) {
 		return tevent_req_post(req, ev);
 	}
 
-	if (src_fsp->fsp_name->st.st_ex_size < state->src_off + num) {
+	if (src_fsp->fsp_name->st.st_ex_size < state->src_off + to_copy) {
 		/*
 		 * [MS-SMB2] 3.3.5.15.6 Handling a Server-Side Data Copy Request
 		 *   If the SourceOffset or SourceOffset + Length extends beyond
@@ -1901,6 +1927,11 @@ static struct tevent_req *vfswrap_offload_write_send(
 		return tevent_req_post(req, ev);
 	}
 
+	state->buf = talloc_array(state, uint8_t, num);
+	if (tevent_req_nomem(state->buf, req)) {
+		return tevent_req_post(req, ev);
+	}
+
 	status = vfswrap_offload_write_loop(req);
 	if (!NT_STATUS_IS_OK(status)) {
 		tevent_req_nterror(req, status);
@@ -1970,7 +2001,7 @@ static void vfswrap_offload_write_read_done(struct tevent_req *subreq)
 	nread = SMB_VFS_PREAD_RECV(subreq, &aio_state);
 	TALLOC_FREE(subreq);
 	if (nread == -1) {
-		DBG_ERR("read failed: %s\n", strerror(errno));
+		DBG_ERR("read failed: %s\n", strerror(aio_state.error));
 		tevent_req_nterror(req, map_nt_error_from_unix(aio_state.error));
 		return;
 	}
@@ -2031,7 +2062,7 @@ static void vfswrap_offload_write_write_done(struct tevent_req *subreq)
 	nwritten = SMB_VFS_PWRITE_RECV(subreq, &aio_state);
 	TALLOC_FREE(subreq);
 	if (nwritten == -1) {
-		DBG_ERR("write failed: %s\n", strerror(errno));
+		DBG_ERR("write failed: %s\n", strerror(aio_state.error));
 		tevent_req_nterror(req, map_nt_error_from_unix(aio_state.error));
 		return;
 	}
diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c
index 443a940b17a..aa262f1d149 100644
--- a/source3/modules/vfs_snapper.c
+++ b/source3/modules/vfs_snapper.c
@@ -2164,24 +2164,6 @@ static int snapper_gmt_lstat(vfs_handle_struct *handle,
 	return ret;
 }
 
-static int snapper_gmt_fstat(vfs_handle_struct *handle, files_struct *fsp,
-			     SMB_STRUCT_STAT *sbuf)
-{
-	time_t timestamp;
-	int ret;
-
-	ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
-	if (ret == -1) {
-		return ret;
-	}
-	if (!snapper_gmt_strip_snapshot(talloc_tos(), handle,
-					fsp->fsp_name->base_name,
-					&timestamp, NULL)) {
-		return 0;
-	}
-	return 0;
-}
-
 static int snapper_gmt_open(vfs_handle_struct *handle,
 			    struct smb_filename *smb_fname, files_struct *fsp,
 			    int flags, mode_t mode)
@@ -3110,7 +3092,6 @@ static struct vfs_fn_pointers snapper_fns = {
 	.symlink_fn = snapper_gmt_symlink,
 	.stat_fn = snapper_gmt_stat,
 	.lstat_fn = snapper_gmt_lstat,
-	.fstat_fn = snapper_gmt_fstat,
 	.open_fn = snapper_gmt_open,
 	.unlink_fn = snapper_gmt_unlink,
 	.chmod_fn = snapper_gmt_chmod,
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 1e9ed331aa6..956c5f0ca09 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -829,8 +829,11 @@ static void smb2_set_operation_credit(struct smbXsrv_connection *xconn,
 	 *       of requests and the used sequence number.
 	 *       Which means we would grant more credits
 	 *       for client which use multi credit requests.
+	 *
+	 * The above is what Windows Server < 2016 is doing,
+	 * but new servers use all credits (8192 by default).
 	 */
-	current_max_credits = xconn->smb2.credits.max / 16;
+	current_max_credits = xconn->smb2.credits.max;
 	current_max_credits = MAX(current_max_credits, 1);
 
 	if (xconn->smb2.credits.multicredit) {
@@ -875,15 +878,19 @@ static void smb2_set_operation_credit(struct smbXsrv_connection *xconn,
 			 * with a successful session setup
 			 */
 			if (NT_STATUS_IS_OK(out_status)) {
-				additional_max = 32;
+				additional_max = xconn->smb2.credits.max;
 			}
 			break;
 		default:
 			/*
-			 * We match windows and only grant additional credits
-			 * in chunks of 32.
+			 * Windows Server < 2016 and older Samba versions
+			 * used to only grant additional credits in
+			 * chunks of 32 credits.
+			 *
+			 * But we match Windows Server 2016 and grant
+			 * all credits as requested.
 			 */
-			additional_max = 32;
+			additional_max = xconn->smb2.credits.max;
 			break;
 		}
 
@@ -1391,7 +1398,7 @@ NTSTATUS smbd_smb2_request_pending_queue(struct smbd_smb2_request *req,
 		return NT_STATUS_OK;
 	}
 
-	if (req->async_internal) {
+	if (req->async_internal || defer_time == 0) {
 		/*
 		 * An SMB2 request implementation wants to handle the request
 		 * asynchronously "internally" while keeping synchronous
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 2c24e7a1abc..807ff81cbe0 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -107,7 +107,16 @@ NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *smb2req)
 	}
 	tevent_req_set_callback(subreq, smbd_smb2_request_sesssetup_done, smb2req);
 
-	return smbd_smb2_request_pending_queue(smb2req, subreq, 500);
+	/*
+	 * Avoid sending a STATUS_PENDING message, which
+	 * matches a Windows Server and avoids problems with
+	 * MacOS clients.
+	 *
+	 * Even after 90 seconds a Windows Server doesn't return
+	 * STATUS_PENDING if using NTLMSSP against a non reachable
+	 * trusted domain.
+	 */
+	return smbd_smb2_request_pending_queue(smb2req, subreq, 0);
 }
 
 static void smbd_smb2_request_sesssetup_done(struct tevent_req *subreq)
@@ -1225,10 +1234,10 @@ NTSTATUS smbd_smb2_request_process_logoff(struct smbd_smb2_request *req)
 	tevent_req_set_callback(subreq, smbd_smb2_request_logoff_done, req);
 
 	/*
-	 * Wait a long time before going async on this to allow
-	 * requests we're waiting on to finish. Set timeout to 10 secs.
+	 * Avoid sending a STATUS_PENDING message, it's very likely
+	 * the client won't expect that.
 	 */
-	return smbd_smb2_request_pending_queue(req, subreq, 10000000);
+	return smbd_smb2_request_pending_queue(req, subreq, 0);
 }
 
 static void smbd_smb2_request_logoff_done(struct tevent_req *subreq)
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index ebd31602efc..c2a5cbc39aa 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -102,7 +102,11 @@ NTSTATUS smbd_smb2_request_process_tcon(struct smbd_smb2_request *req)
 	}
 	tevent_req_set_callback(subreq, smbd_smb2_request_tcon_done, req);
 
-	return smbd_smb2_request_pending_queue(req, subreq, 500);
+	/*
+	 * Avoid sending a STATUS_PENDING message, it's very likely
+	 * the client won't expect that.
+	 */
+	return smbd_smb2_request_pending_queue(req, subreq, 0);
 }
 
 static void smbd_smb2_request_tcon_done(struct tevent_req *subreq)
@@ -498,10 +502,10 @@ NTSTATUS smbd_smb2_request_process_tdis(struct smbd_smb2_request *req)
 	tevent_req_set_callback(subreq, smbd_smb2_request_tdis_done, req);
 
 	/*
-	 * Wait a long time before going async on this to allow
-	 * requests we're waiting on to finish. Set timeout to 10 secs.
+	 * Avoid sending a STATUS_PENDING message, it's very likely
+	 * the client won't expect that.
 	 */
-	return smbd_smb2_request_pending_queue(req, subreq, 10000000);
+	return smbd_smb2_request_pending_queue(req, subreq, 0);
 }
 
 static void smbd_smb2_request_tdis_done(struct tevent_req *subreq)
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 108bd570922..e68bf6dd69b 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2109,12 +2109,14 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx,
 		SOFF_T(p,0,allocation_size); p += 8;
 		SIVAL(p,0,mode); p += 4;
 		q = p; p += 4; /* q is placeholder for name length. */
-		{
+		if (mode & FILE_ATTRIBUTE_REPARSE_POINT) {
+			SIVAL(p, 0, IO_REPARSE_TAG_DFS);
+		} else {
 			unsigned int ea_size = estimate_ea_size(conn, NULL,
 								smb_fname);
 			SIVAL(p,0,ea_size); /* Extended attributes */
-			p +=4;
 		}
+		p +=4;
 		status = srvstr_push(base_data, flags2, p,
 				  fname, PTR_DIFF(end_data, p),
 				  STR_TERMINATE_ASCII, &len);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list