From 21de00f9c8e3b05e36aed6d481718ec53b6f0c06 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher 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. 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 Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit 4760b85243f335bb2094fc779802ce4b52db0ccb) --- 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 1e9ed331aa6a..174b906f8b6c 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1391,7 +1391,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.1 From 0fd29a2903aa3fca69f93b226cd56ef0c9e0d9e8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher 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 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13796 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit 23792449694b5221f6ea422166c96fac494e3e2c) --- 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 2c24e7a1abcb..c77c83c0ee98 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.1 From e92f97807144bcc111575a8c9f6e5fd3885c2a16 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher 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 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13698 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit 8a11da429bd3c89766f43c2bff681837a769987c) --- 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 ebd31602efcd..5f103807eb35 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.1 From 032c2a730c80650b46fba7dc610aed8952c93176 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher 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 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13698 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit d64038425f250e253dce707d69899c7a5d8cb32e) --- 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 c77c83c0ee98..807ff81cbe04 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -1234,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) -- 2.17.1 From 818db91ed132602b262d266c60543635e828e354 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher 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 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13698 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison (cherry picked from commit 1dc002548336b969979c3bf85b531c059d87f015) --- 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 5f103807eb35..c2a5cbc39aa0 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.1