The Samba-Bugzilla – Attachment 15677 Details for
Bug 13218
SMB2 keepalive/echo terminates connection
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Corrected version that doesn't change the error return from 1 -> -1.
0001-s3-libsmbclient-Cope-with-SMB2-servers-that-return-S.patch (text/plain), 1.89 KB, created by
Jeremy Allison
on 2019-12-11 23:19:08 UTC
(
hide
)
Description:
Corrected version that doesn't change the error return from 1 -> -1.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2019-12-11 23:19:08 UTC
Size:
1.89 KB
patch
obsolete
>From e6fa5d1bf5042dc909ff28a6a9cfd15afec631fc Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Wed, 11 Dec 2019 15:06:40 -0800 >Subject: [PATCH] s3: libsmbclient: Cope with SMB2 servers that return > STATUS_USER_SESSION_DELETED on a SMB2_ECHO (SMB2_OP_KEEPALIVE) call with a > NULL session. > >This is already tested by smb2.session.expire which >shows that Windows and Samba servers don't need this, >but some third party server are returning STATUS_USER_SESSION_DELETED >with a NULL sessionid. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13218 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/libsmb/libsmb_server.c | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c >index 0067df48cac..9c3d0689f02 100644 >--- a/source3/libsmb/libsmb_server.c >+++ b/source3/libsmb/libsmb_server.c >@@ -61,14 +61,33 @@ SMBC_check_server(SMBCCTX * context, > 1, > data_blob_const(data, sizeof(data))); > if (!NT_STATUS_IS_OK(status)) { >+ bool ok = false; >+ /* >+ * Some SMB2 servers (not Samba or Windows) >+ * check the session status on SMB2_ECHO and return >+ * NT_STATUS_USER_SESSION_DELETED >+ * if the session was not set. That's OK, they still >+ * replied. >+ * BUG: https://bugzilla.samba.org/show_bug.cgi?id=13218 >+ */ >+ if (smbXcli_conn_protocol(server->cli->conn) >= >+ PROTOCOL_SMB2_02) { >+ if (NT_STATUS_EQUAL(status, >+ NT_STATUS_USER_SESSION_DELETED)) { >+ ok = true; >+ } >+ } > /* > * Some NetApp servers return > * NT_STATUS_INVALID_PARAMETER.That's OK, they still > * replied. > * BUG: https://bugzilla.samba.org/show_bug.cgi?id=13007 > */ >- if (!NT_STATUS_EQUAL(status, >+ if (NT_STATUS_EQUAL(status, > NT_STATUS_INVALID_PARAMETER)) { >+ ok = true; >+ } >+ if (!ok) { > return 1; > } > } >-- >2.24.1.735.g03f4e72817-goog >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 13218
:
15676
| 15677