From 930604caef178b96a526d5501ee8c47747718e54 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 af065e9e43ff..0b80da346513 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1389,7 +1389,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 0b5a60e800518e9980cc4da92609fd93ad1a557c 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 6b2f8ed9ffd4dcc38b525d3032fbbff5026ecc7c 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 07e01cddd463..97058688350a 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 98c3b50382a1309be81fef26e3761f7a84385eb3 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 65a24bbd1bd53abcad79538a5cf8a48541f7aac0 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 97058688350a..d4980f2f36af 100644 --- a/source3/smbd/smb2_tcon.c +++ b/source3/smbd/smb2_tcon.c @@ -487,10 +487,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