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

Karolin Seeger kseeger at samba.org
Wed Apr 24 11:06:03 UTC 2019


The branch, v4-9-test has been updated
       via  571f7034fcc docs/vfs_ceph: describe new ACL behaviour
       via  c5089041e62 vfs_ceph: explicitly enable libcephfs POSIX ACL support
       via  7abc1442500 smb2_server: grant all 8192 credits to clients
       via  74001095d25 vfs_default: fix vfswrap_offload_write_send() NT_STATUS_INVALID_VIEW_SIZE check
       via  a50c4d7a891 vfs_default: fix DEBUG messages in vfswrap_offload_write_*_done()
       via  dedeaf370eb vfs_snapper: drop unneeded fstat handler
       via  c8bdbc39955 smb2_tcon: avoid STATUS_PENDING completely on tdis
       via  d8d3e6895ae smb2_sesssetup: avoid STATUS_PENDING completely on session logoff
       via  6122f423d8d smb2_tcon: avoid STATUS_PENDING responses for tree connect
       via  dc06b1b364d smb2_sesssetup: avoid STATUS_PENDING responses for session setup
       via  8d6361b63bb smb2_server: allow smbd_smb2_request_pending_queue(0) to avoid STATUS_PENDING
       via  7aa443a3cf3 s3:smbd: handle IO_REPARSE_TAG_DFS in SMB_FIND_FILE_FULL_DIRECTORY_INFO
      from  945a41d3841 ctdb-common: Avoid race between fd and signal events

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


- Log -----------------------------------------------------------------
commit 571f7034fcca118b455c2f8f35ee88f1b081c0d9
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-9-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-9-test): Wed Apr 24 11:05:08 UTC 2019 on sn-devel-144

commit c5089041e6210e8b8836a227d92348aa0b3983a0
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 7abc14425006beacfa1c5e296d3ddb506e6b3285
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 74001095d25e6130979b5c9c973cc2414c9d60f7
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 a50c4d7a8915630c8d2707d07b6e6fd51e421e6d
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 dedeaf370eb40d55e0bb7d832e9e54bdf6baf49b
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 c8bdbc39955fb106e0a790af5a85df1a444736a0
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 d8d3e6895ae08f1f928fe8af3489f443c1cfb8b8
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 6122f423d8d9f2e5a49f090f0ed6c276e0d387dc
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 dc06b1b364dc98e32147914e10a2bd08c88786a1
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 8d6361b63bbd34ae970a59c06904193e04e9accc
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 7aa443a3cf33b22ad454e72380546a64adeb28b2
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 baf3d57a31a..f850d9e1a87 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -327,9 +327,6 @@
 ^samba.tests.dcerpc.dnsserver.samba.tests.dcerpc.dnsserver.DnsserverTests.test_add_duplicate_different_type.*
 ^samba.tests.dcerpc.dnsserver.samba.tests.dcerpc.dnsserver.DnsserverTests.test_rank_none.*
 ^samba.tests.dcerpc.dnsserver.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 a3fd6095ef5..5ba7ef0bb25 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 ce5efd82a64..7dfa335190c 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1630,6 +1630,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;
@@ -1681,6 +1683,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)) {
@@ -1704,17 +1735,12 @@ static struct tevent_req *vfswrap_offload_write_send(
 	state->src_ev = src_fsp->conn->user_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
@@ -1728,6 +1754,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);
@@ -1797,7 +1828,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;
 	}
@@ -1858,7 +1889,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 6b935c3df41..daeede9d5b8 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 2e83b7708f6..cfcc5c13543 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;
 		}
 
@@ -1390,7 +1397,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 5420d4f09bb..bd0ab9af737 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 3a4a15d3059..679bbe504d9 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 0ec1c5f2a6a..5d1ad550e8a 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -2125,12 +2125,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