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

Jule Anger janger at samba.org
Fri Sep 22 20:35:02 UTC 2023


The branch, v4-19-test has been updated
       via  79101588626 smbd: Fix BZ15481
       via  ebc4bbbf707 tests: Add reproducer for BZ15481
       via  9ba1c94e3e1 s4:kdc: Add correct Asserted Identity SID in response to an S4U2Self request
       via  c30984f095d s3: smbd: Ensure we remove any pending aio values for named pipes on forced shutdown.
       via  09e00c0a6c5 s3: torture: Add a new SMB2 test: SMB2-PIPE-READ-ASYNC-DISCONNECT
       via  f3d07e123ec s3: smbd: named pipe writes are async. Use the same logic as for named pipe transacts to avoid crashes on shutdown.
       via  68b8a5c438d s3: smbd: named pipe reads are async. Use the same logic as for named pipe transacts to avoid crashes on shutdown.
       via  3ac075735c1 s3: smbd: Add some DEVELOPER-only code to panic if the destructor for an aio_lnk is called and the associated fsp doesn't exist.
      from  d70374c3479 s3: libsmb: Add a missing return statement in the timeout case.

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


- Log -----------------------------------------------------------------
commit 79101588626972b3aaa2ffc98bbde476596691d0
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Sep 19 17:44:56 2023 -0700

    smbd: Fix BZ15481
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=15481
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Sep 20 22:42:48 UTC 2023 on atb-devel-224
    
    (cherry picked from commit 3481bbfede5127e3664bcf464a0ae3dec9247ab7)
    
    Autobuild-User(v4-19-test): Jule Anger <janger at samba.org>
    Autobuild-Date(v4-19-test): Fri Sep 22 20:34:16 UTC 2023 on atb-devel-224

commit ebc4bbbf7072307b743cb2ac53c6e86f71b834c6
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 20 10:53:52 2023 -0700

    tests: Add reproducer for BZ15481
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=15481
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 56df75d44795582dcecb8676a0d80d6f4a46c7e9)

commit 9ba1c94e3e133a56e04f7388554b99c57753314a
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Mon Sep 4 13:20:34 2023 +1200

    s4:kdc: Add correct Asserted Identity SID in response to an S4U2Self request
    
    I’m not sure exactly how this check was supposed to work. But in any
    case, within fast_unwrap_request() the Heimdal KDC replaces the outer
    padata with the padata from the inner FAST request. Hence, this check
    does not accomplish anything useful: at no point should the KDC plugin
    see the outer padata.
    
    A couple of unwanted consequences resulted from this check. One was that
    a client who sent empty FX‐FAST padata within the inner FAST request
    would receive the *Authentication Authority* Asserted Identity SID
    instead of the *Service* Asserted Identity SID. Another consequence was
    that a client could in the same manner bypass the restriction on
    performing S4U2Self with an RODC‐issued TGT.
    
    Overall, samba_wdc_is_s4u2self_req() is somewhat of a hack. But the
    Heimdal plugin API gives us nothing better to work with.
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 5c580dbdb3e6a70c8d2f5059e2b7293a7e780414)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15477

commit c30984f095d2be4fe431544073dcad2a4c45d3d5
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Sep 19 14:36:45 2023 -0700

    s3: smbd: Ensure we remove any pending aio values for named pipes on forced shutdown.
    
    Matches file and directory closes.
    
    Remove knownfail.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15423
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Sep 20 02:43:18 UTC 2023 on atb-devel-224
    
    (cherry picked from commit 11280f1705c0faa1729f5aeaa1b6a1f79ab5a199)

commit 09e00c0a6c500d88d2d43cd1538ec10fda6b7692
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Sep 19 14:30:26 2023 -0700

    s3: torture: Add a new SMB2 test: SMB2-PIPE-READ-ASYNC-DISCONNECT
    
    Shows the server crashes if we open a named pipe, do an async read
    and then disconnect.
    
    Adds knownfail:
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15423
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 66398dd03c46633b474438dddb771caa2d245e64)

commit f3d07e123ec254fdfea8f2c36c3a6532be8b369e
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Sep 18 17:37:44 2023 -0700

    s3: smbd: named pipe writes are async. Use the same logic as for named pipe transacts to avoid crashes on shutdown.
    
    Noticed by Metze.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15423
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit ea062c3b0d4dbb1f0682f808ac893bf36a6fb194)

commit 68b8a5c438d296a30f37cc180f9699d49fef70b4
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Sep 18 17:09:00 2023 -0700

    s3: smbd: named pipe reads are async. Use the same logic as for named pipe transacts to avoid crashes on shutdown.
    
    Noticed by Metze.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15423
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 3f32bf887d4425655e81da0b2234cbca3b1d56e6)

commit 3ac075735c191bb69c2d841a44c6e9c3bf75d3bf
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Sep 18 14:43:23 2023 -0700

    s3: smbd: Add some DEVELOPER-only code to panic if the destructor for an aio_lnk is called and the associated fsp doesn't exist.
    
    Make this DEVELOPER-only as it walks the entire open
    file list on every file close (with associated aio).
    
    This helps catch really subtle problems with orphaned
    aio lnk structs.
    
    Reproducer test case to follow.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15423
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 82e88f70f181300f6f98691f6680839a94470e13)

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

Summary of changes:
 python/samba/tests/libsmb-basic.py                 |  27 +++++
 ...torture_s3.sh => test_smbtorture_nocrash_s3.sh} |  12 +++
 source3/selftest/tests.py                          |  16 +++
 source3/smbd/close.c                               |   8 ++
 source3/smbd/filename.c                            |  12 ++-
 source3/smbd/smb2_aio.c                            |  24 +++++
 source3/smbd/smb2_read.c                           |  13 +++
 source3/smbd/smb2_write.c                          |  13 +++
 source3/torture/proto.h                            |   1 +
 source3/torture/test_smb2.c                        | 117 +++++++++++++++++++++
 source3/torture/torture.c                          |   4 +
 source4/kdc/wdc-samba4.c                           |  22 ----
 12 files changed, 246 insertions(+), 23 deletions(-)
 copy source3/script/tests/{test_smbtorture_s3.sh => test_smbtorture_nocrash_s3.sh} (62%)


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/libsmb-basic.py b/python/samba/tests/libsmb-basic.py
index cbe7cce5bae..163c5b09ea9 100644
--- a/python/samba/tests/libsmb-basic.py
+++ b/python/samba/tests/libsmb-basic.py
@@ -215,6 +215,33 @@ class LibsmbTestCase(samba.tests.libsmb.LibsmbTests):
             c1.unlink("x")
             c1 = None
 
+    def test_gencache_pollution_bz15481(self):
+        c = libsmb.Conn(self.server_ip, "tmp", self.lp, self.creds)
+        fh = c.create("file",
+                      DesiredAccess=security.SEC_STD_DELETE,
+                      CreateDisposition=libsmb.FILE_CREATE)
+
+        # prime the gencache File->file
+        fh_upper = c.create("File",
+                            DesiredAccess=security.SEC_FILE_READ_ATTRIBUTE,
+                            CreateDisposition=libsmb.FILE_OPEN)
+        c.close(fh_upper)
+
+        c.delete_on_close(fh, 1)
+        c.close(fh)
+
+        fh = c.create("File",
+                      DesiredAccess=security.SEC_STD_DELETE,
+                      CreateDisposition=libsmb.FILE_CREATE)
+
+        directory = c.list("\\", "File")
+
+        c.delete_on_close(fh, 1)
+        c.close(fh)
+
+        # Without the bugfix for 15481 we get 'file' not 'File'
+        self.assertEqual(directory[0]['name'], 'File')
+
 if __name__ == "__main__":
     import unittest
     unittest.main()
diff --git a/source3/script/tests/test_smbtorture_s3.sh b/source3/script/tests/test_smbtorture_nocrash_s3.sh
similarity index 62%
copy from source3/script/tests/test_smbtorture_s3.sh
copy to source3/script/tests/test_smbtorture_nocrash_s3.sh
index 4376f4a7199..b6ef1391262 100755
--- a/source3/script/tests/test_smbtorture_s3.sh
+++ b/source3/script/tests/test_smbtorture_nocrash_s3.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+. $(dirname $0)/../../../testprogs/blackbox/subunit.sh
+
 # this runs the file serving tests that are expected to pass with samba3
 
 if [ $# -lt 5 ]; then
@@ -20,7 +22,17 @@ ADDARGS="$*"
 incdir=$(dirname $0)/../../../testprogs/blackbox
 . $incdir/subunit.sh
 
+panic_count_0=$(grep -c PANIC $SMBD_TEST_LOG)
+
+echo "$panic_count_0" >/tmp/look
+
 failed=0
 testit "smbtorture" $VALGRIND $SMBTORTURE $unc -U"$username"%"$password" $ADDARGS $t || failed=$(expr $failed + 1)
 
+panic_count_1=$(grep -c PANIC $SMBD_TEST_LOG)
+
+echo "$panic_count_1" >>/tmp/look
+
+testit "check_panic" test $panic_count_0 -eq $panic_count_1 || failed=$(expr $failed + 1)
+
 testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 783cb486012..8986a73f03a 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -481,6 +481,22 @@ plantestsuite("samba3.smbtorture_s3.plain.%s" % "SMB2-DEL-ON-CLOSE-NONWRITE-DELE
                 "",
                 "-l $LOCAL_PATH"])
 
+#
+# Test doing an async read + disconnect on a pipe doesn't crash the server.
+# BUG: https://bugzilla.samba.org/show_bug.cgi?id=15423
+#
+plantestsuite("samba3.smbtorture_s3.plain.%s" % "SMB2-PIPE-READ-ASYNC-DISCONNECT",
+                "fileserver",
+                [os.path.join(samba3srcdir,
+                              "script/tests/test_smbtorture_nocrash_s3.sh"),
+                'SMB2-PIPE-READ-ASYNC-DISCONNECT',
+                '//$SERVER_IP/tmp',
+                '$USERNAME',
+                '$PASSWORD',
+                smbtorture3,
+                "",
+                "-l $LOCAL_PATH"])
+
 shares = [
     "vfs_aio_pthread_async_dosmode_default1",
     "vfs_aio_pthread_async_dosmode_default2"
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 2b180e0c718..af5e78daa10 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -1630,6 +1630,14 @@ NTSTATUS close_file_smb(struct smb_request *req,
 	SMB_ASSERT(fsp->stream_fsp == NULL);
 
 	if (fsp->fake_file_handle != NULL) {
+		/*
+		 * Named pipes are opened as fake files and
+		 * can have pending aio requests. Ensure
+		 * we clear out all pending aio on force
+		 * shutdown of named pipes also.
+		 * BUG: https://bugzilla.samba.org/show_bug.cgi?id=15423
+		 */
+		assert_no_pending_aio(fsp, close_type);
 		status = close_fake_file(req, fsp);
 	} else if (fsp->print_file != NULL) {
 		/* FIXME: return spool errors */
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 9bd3ee77547..b00f85171ca 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -784,6 +784,7 @@ static NTSTATUS openat_pathref_fsp_case_insensitive(
 
 	if (lp_stat_cache()) {
 		char *base_name = smb_fname_rel->base_name;
+		char *original_relname = NULL;
 		DATA_BLOB value = { .data = NULL };
 
 		ok = get_real_filename_cache_key(
@@ -805,7 +806,13 @@ static NTSTATUS openat_pathref_fsp_case_insensitive(
 		}
 		DO_PROFILE_INC(statcache_hits);
 
-		TALLOC_FREE(smb_fname_rel->base_name);
+		/*
+		 * For the "new filename" case we need to preserve the
+		 * capitalization the client sent us, see
+		 * https://bugzilla.samba.org/show_bug.cgi?id=15481
+		 */
+		original_relname = smb_fname_rel->base_name;
+
 		smb_fname_rel->base_name = talloc_memdup(
 			smb_fname_rel, value.data, value.length);
 		if (smb_fname_rel->base_name == NULL) {
@@ -823,10 +830,13 @@ static NTSTATUS openat_pathref_fsp_case_insensitive(
 		status = openat_pathref_fsp(dirfsp, smb_fname_rel);
 		if (NT_STATUS_IS_OK(status)) {
 			TALLOC_FREE(cache_key.data);
+			TALLOC_FREE(original_relname);
 			return NT_STATUS_OK;
 		}
 
 		memcache_delete(NULL, GETREALFILENAME_CACHE, cache_key);
+		TALLOC_FREE(smb_fname_rel->base_name);
+		smb_fname_rel->base_name = original_relname;
 	}
 
 lookup:
diff --git a/source3/smbd/smb2_aio.c b/source3/smbd/smb2_aio.c
index 8c01c76a3e9..88aa68d218f 100644
--- a/source3/smbd/smb2_aio.c
+++ b/source3/smbd/smb2_aio.c
@@ -64,6 +64,9 @@ struct aio_extra *create_aio_extra(TALLOC_CTX *mem_ctx,
 }
 
 struct aio_req_fsp_link {
+#ifdef DEVELOPER
+	struct smbd_server_connection *sconn;
+#endif
 	files_struct *fsp;
 	struct tevent_req *req;
 };
@@ -74,6 +77,24 @@ static int aio_del_req_from_fsp(struct aio_req_fsp_link *lnk)
 	files_struct *fsp = lnk->fsp;
 	struct tevent_req *req = lnk->req;
 
+#ifdef DEVELOPER
+	struct files_struct *ifsp = NULL;
+	bool found = false;
+
+	/*
+	 * When this is called, lnk->fsp must still exist
+	 * on the files list for this connection. Panic if not.
+	 */
+	for (ifsp = lnk->sconn->files; ifsp; ifsp = ifsp->next) {
+		if (ifsp == fsp) {
+			found = true;
+		}
+	}
+	if (!found) {
+		smb_panic("orphaned lnk on fsp aio list.\n");
+	}
+#endif
+
 	for (i=0; i<fsp->num_aio_requests; i++) {
 		if (fsp->aio_requests[i] == req) {
 			break;
@@ -130,6 +151,9 @@ bool aio_add_req_to_fsp(files_struct *fsp, struct tevent_req *req)
 
 	lnk->fsp = fsp;
 	lnk->req = req;
+#ifdef DEVELOPER
+	lnk->sconn = fsp->conn->sconn;
+#endif
 	talloc_set_destructor(lnk, aio_del_req_from_fsp);
 
 	return true;
diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c
index 0101c42cf76..bac78e4c77a 100644
--- a/source3/smbd/smb2_read.c
+++ b/source3/smbd/smb2_read.c
@@ -494,6 +494,7 @@ static struct tevent_req *smbd_smb2_read_send(TALLOC_CTX *mem_ctx,
 
 	if (IS_IPC(smbreq->conn)) {
 		struct tevent_req *subreq = NULL;
+		bool ok;
 
 		state->out_data = data_blob_talloc(state, NULL, in_length);
 		if (in_length > 0 && tevent_req_nomem(state->out_data.data, req)) {
@@ -515,6 +516,18 @@ static struct tevent_req *smbd_smb2_read_send(TALLOC_CTX *mem_ctx,
 		tevent_req_set_callback(subreq,
 					smbd_smb2_read_pipe_done,
 					req);
+
+		/*
+		 * Make sure we mark the fsp as having outstanding async
+		 * activity so we don't crash on shutdown close.
+		 */
+
+		ok = aio_add_req_to_fsp(fsp, req);
+		if (!ok) {
+			tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+			return tevent_req_post(req, ev);
+		}
+
 		return req;
 	}
 
diff --git a/source3/smbd/smb2_write.c b/source3/smbd/smb2_write.c
index 269c489642e..a7af20173a1 100644
--- a/source3/smbd/smb2_write.c
+++ b/source3/smbd/smb2_write.c
@@ -307,6 +307,7 @@ static struct tevent_req *smbd_smb2_write_send(TALLOC_CTX *mem_ctx,
 
 	if (IS_IPC(smbreq->conn)) {
 		struct tevent_req *subreq = NULL;
+                bool ok;
 
 		if (!fsp_is_np(fsp)) {
 			tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
@@ -323,6 +324,18 @@ static struct tevent_req *smbd_smb2_write_send(TALLOC_CTX *mem_ctx,
 		tevent_req_set_callback(subreq,
 					smbd_smb2_write_pipe_done,
 					req);
+
+		/*
+		 * Make sure we mark the fsp as having outstanding async
+		 * activity so we don't crash on shutdown close.
+		 */
+
+		ok = aio_add_req_to_fsp(fsp, req);
+		if (!ok) {
+			tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+			return tevent_req_post(req, ev);
+		}
+
 		return req;
 	}
 
diff --git a/source3/torture/proto.h b/source3/torture/proto.h
index 93d0727e936..0206cf15c9a 100644
--- a/source3/torture/proto.h
+++ b/source3/torture/proto.h
@@ -124,6 +124,7 @@ bool run_smb2_dfs_paths(int dummy);
 bool run_smb2_non_dfs_share(int dummy);
 bool run_smb2_dfs_share_non_dfs_path(int dummy);
 bool run_smb2_dfs_filename_leading_backslash(int dummy);
+bool run_smb2_pipe_read_async_disconnect(int dummy);
 bool run_smb1_dfs_paths(int dummy);
 bool run_smb1_dfs_search_paths(int dummy);
 bool run_smb1_dfs_operations(int dummy);
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c
index 3cb6d13789a..672c38e2b55 100644
--- a/source3/torture/test_smb2.c
+++ b/source3/torture/test_smb2.c
@@ -5136,3 +5136,120 @@ bool run_smb2_dfs_filename_leading_backslash(int dummy)
 	(void)smb2_dfs_delete(cli, dfs_filename_slash);
 	return retval;
 }
+
+/*
+ * Ensure a named pipe async read followed by a disconnect
+ * doesn't crash the server (server crash checked for in
+ * containing test script:
+ * source3/script/tests/test_smbtorture_nocrash_s3.sh)
+ * BUG: https://bugzilla.samba.org/show_bug.cgi?id=15423
+ */
+
+bool run_smb2_pipe_read_async_disconnect(int dummy)
+{
+	struct cli_state *cli = NULL;
+	NTSTATUS status;
+	uint64_t fid_persistent = 0;
+	uint64_t fid_volatile = 0;
+	struct tevent_context *ev;
+	struct tevent_req *req;
+	bool retval = false;
+
+	printf("Starting SMB2-PIPE-READ-ASYNC-DISCONNECT\n");
+
+	if (!torture_init_connection(&cli)) {
+		return false;
+	}
+
+	status = smbXcli_negprot(cli->conn,
+				cli->timeout,
+				PROTOCOL_SMB2_02,
+				PROTOCOL_SMB3_11);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("smbXcli_negprot returned %s\n", nt_errstr(status));
+		return false;
+	}
+
+	status = cli_session_setup_creds(cli, torture_creds);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("cli_session_setup returned %s\n", nt_errstr(status));
+		return false;
+	}
+
+	status = cli_tree_connect_creds(cli, "IPC$", "IPC", torture_creds);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("cli_tree_connect to IPC$ returned %s\n",
+			nt_errstr(status));
+		return false;
+	}
+
+	/* Open the SAMR pipe. */
+	status = smb2cli_create(cli->conn,
+				cli->timeout,
+				cli->smb2.session,
+				cli->smb2.tcon,
+				"SAMR",
+				SMB2_OPLOCK_LEVEL_NONE, /* oplock_level, */
+				SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level, */
+				SEC_STD_SYNCHRONIZE|
+					SEC_FILE_READ_DATA|
+					SEC_FILE_WRITE_DATA, /* desired_access, */
+				FILE_ATTRIBUTE_NORMAL, /* file_attributes, */
+				FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, /* share_access, */
+				FILE_OPEN, /* create_disposition, */
+				0, /* create_options, */
+				NULL, /* smb2_create_blobs *blobs */
+				&fid_persistent,
+				&fid_volatile,
+				NULL, /* struct smb_create_returns * */
+				talloc_tos(), /* mem_ctx. */
+				NULL, /* struct smb2_create_blobs * */
+				NULL); /* psymlink */
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("%s:%d smb2cli_create on SAMR returned %s\n",
+			__FILE__,
+			__LINE__,
+			nt_errstr(status));
+		goto err;
+	}
+
+	ev = samba_tevent_context_init(talloc_tos());
+	if (ev == NULL) {
+		goto err;
+	}
+
+	/* Start an async read. */
+	req = smb2cli_read_send(talloc_tos(),
+				ev,
+				cli->conn,
+				cli->timeout,
+				cli->smb2.session,
+				cli->smb2.tcon,
+				16*1024,
+				0, /* offset */
+				fid_persistent,
+				fid_volatile,
+				0, /* minimum_count */
+				0); /* remaining_bytes */
+	if (req == NULL) {
+		goto err;
+	}
+
+	/* Force disconnect. */
+	smbXcli_conn_disconnect(cli->conn, NT_STATUS_LOCAL_DISCONNECT);
+	fid_volatile = 0;
+	retval = true;
+
+  err:
+
+	if (fid_volatile != 0) {
+		smb2cli_close(cli->conn,
+			      cli->timeout,
+			      cli->smb2.session,
+			      cli->smb2.tcon,
+			      0, /* flags */
+			      fid_persistent,
+			      fid_volatile);
+	}
+	return retval;
+}
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 2a8b8dec22f..9a1420c9e3a 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -15763,6 +15763,10 @@ static struct {
 		.name  = "SMB2-DFS-FILENAME-LEADING-BACKSLASH",
 		.fn    = run_smb2_dfs_filename_leading_backslash,
 	},
+	{
+		.name  = "SMB2-PIPE-READ-ASYNC-DISCONNECT",
+		.fn    = run_smb2_pipe_read_async_disconnect,
+	},
 	{
 		.name  = "SMB1-TRUNCATED-SESSSETUP",
 		.fn    = run_smb1_truncated_sesssetup,
diff --git a/source4/kdc/wdc-samba4.c b/source4/kdc/wdc-samba4.c
index 6b3731d55de..cbfea945630 100644
--- a/source4/kdc/wdc-samba4.c
+++ b/source4/kdc/wdc-samba4.c
@@ -37,7 +37,6 @@
 
 static bool samba_wdc_is_s4u2self_req(astgs_request_t r)
 {
-	krb5_kdc_configuration *config = kdc_request_get_config((kdc_request_t)r);
 	const KDC_REQ *req = kdc_request_get_req(r);
 	const PA_DATA *pa_for_user = NULL;
 
@@ -45,27 +44,6 @@ static bool samba_wdc_is_s4u2self_req(astgs_request_t r)
 		return false;
 	}
 
-	if (config->enable_fast && req->padata != NULL) {
-		const PA_DATA *pa_fx_fast = NULL;
-		int idx = 0;
-
-		pa_fx_fast = krb5_find_padata(req->padata->val,
-					      req->padata->len,
-					      KRB5_PADATA_FX_FAST,
-					      &idx);
-		if (pa_fx_fast != NULL) {
-			/*
-			 * We're in the outer request
-			 * with KRB5_PADATA_FX_FAST
-			 * if fast is enabled we'll
-			 * process the s4u2self
-			 * request only in the
-			 * inner request.
-			 */
-			return false;
-		}
-	}
-
 	if (req->padata != NULL) {
 		int idx = 0;
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list