Apple has a bug in credit handling with their smbfs, it seems :-)

Ralph Böhme slow at samba.org
Tue Feb 19 18:06:28 UTC 2019


On Tue, Feb 19, 2019 at 06:50:56PM +0100, David Disseldorp via samba-technical wrote:
>On Wed, 23 Jan 2019 21:36:48 +0100, Stefan Metzmacher via samba-technical wrote:
>
>> >> I'd propose to skip the STATUS_PENDING using
>> >> smb2_request_set_async_internal() and leave the credit handling as is.
>> >
>> > Trouble with that is the client may then timeout.
>>
>> I think that's what windows also does that, but we should retest that
>> with a Samba dc and sleep(60) in SamLogon*.
>
>Do we have a bugzilla ticket to track this client bug workaround?
>Noel and I are currently investigating a similar report.

not really, but we have a WIP patchset.

These are WIP patches, please don't push. :)

-slow

-- 
Ralph Boehme, Samba Team                https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG-Fingerprint   FAE2C6088A24252051C559E4AA1E9B7126399E46
-------------- next part --------------
From 2be22ec51c1002476ac59f7bcfbce6375b77a06f Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Tue, 12 Feb 2019 08:08:38 +0100
Subject: [PATCH 1/5] 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.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/smbd/smb2_server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 85b26f52cf2..956c5f0ca09 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -1398,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
-- 
2.17.2


From d1ad289c18f7b1e379bb39b6b315ceb493254f16 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 24 Jan 2019 09:10:11 +0100
Subject: [PATCH 2/5] 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

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/smbd/smb2_sesssetup.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index d34951a4eef..e3d58d312e4 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)
-- 
2.17.2


From fd4352e7697455e0b81c9522c72371e4bbdc6f29 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Thu, 24 Jan 2019 09:10:11 +0100
Subject: [PATCH 3/5] smb2_tcon: avoid STATUS_PENDING responses for tree
 connect

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12844

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/smbd/smb2_tcon.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index ebd31602efc..5f103807eb3 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)
-- 
2.17.2


From 5653657b64137f9cb0fa49355ff616225019203b Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Tue, 12 Feb 2019 08:27:43 +0100
Subject: [PATCH 4/5] smb2_sesssetup: avoid STATUS_PENDING completely on
 session logoff

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10344

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/smbd/smb2_sesssetup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index e3d58d312e4..9591a8823dd 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -1259,10 +1259,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)
-- 
2.17.2


From 757728b6bddd8f7cae2b3fae08143beabff380f2 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Tue, 12 Feb 2019 08:27:43 +0100
Subject: [PATCH 5/5] smb2_tcon: avoid STATUS_PENDING completely on tdis

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10344

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source3/smbd/smb2_tcon.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index 5f103807eb3..c2a5cbc39aa 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -502,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)
-- 
2.17.2



More information about the samba-technical mailing list