Bug 13007 - smbclient should not terminate the connection if a ECHO request gets an error returned from the server
Summary: smbclient should not terminate the connection if a ECHO request gets an error...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 4.6.2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-31 12:50 UTC by Andreas Schneider
Modified: 2017-11-22 08:14 UTC (History)
3 users (show)

See Also:


Attachments
git-am fix for master (1.19 KB, patch)
2017-09-08 23:22 UTC, Jeremy Allison
no flags Details
git-am fix for master (1.93 KB, patch)
2017-09-08 23:29 UTC, Jeremy Allison
asn: review+
Details
git-am fix for 4.7.next, 4.6.next. (2.16 KB, patch)
2017-11-14 21:00 UTC, Jeremy Allison
asn: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schneider 2017-08-31 12:50:06 UTC
Currently when we connect to a NetApp server and smbclient or libsmbclient sends an echo request a NetApp Server responds with STATUS_INVALID_PARAMETER because it can't deal with a session ID of 0.
If we get a response from a server we should not terminate the connection but see it as the server is responsive.


Quote from cifs-protocol:

Client behavior in regards to ECHO is implementation-specific (there is no mention in section 3.2). ECHO is merely a keep-alive ping to see if the server is responsive, so any response could be considered success. All the Server does (besides disconnecting the connection if Connection.SessionTable is empty) is validate the structure of the request. If the server returns STATUS_INVALID_PARAMETER, this indicates the Client formed the request incorrectly, but shows the Server is responsive (as does any response, error or success). 

See https://lists.samba.org/archive/cifs-protocol/2017-July/003071.html


The server docs have been updated, see:
https://lists.samba.org/archive/cifs-protocol/2017-July/003073.html
Comment 1 Jeremy Allison 2017-09-08 23:22:47 UTC
Created attachment 13561 [details]
git-am fix for master

Andreas, can you test this please ? I don't have a NetApp here.
Comment 2 Jeremy Allison 2017-09-08 23:29:34 UTC
Created attachment 13562 [details]
git-am fix for master

Forgot to fix smbclient as well in previous patch.
Comment 3 Andreas Schneider 2017-09-12 10:09:36 UTC
I will try to get feedback. However could be October ...
Comment 4 Andreas Schneider 2017-11-10 10:07:25 UTC
Comment on attachment 13562 [details]
git-am fix for master

Pushed to autobuild.
Comment 5 Jeremy Allison 2017-11-14 21:00:54 UTC
Created attachment 13779 [details]
git-am fix for 4.7.next, 4.6.next.

Cherry-picked from master.
Comment 6 Andreas Schneider 2017-11-15 08:07:03 UTC
Karolin, please add the patch to the relevant branches. Thanks!
Comment 7 Karolin Seeger 2017-11-17 09:00:38 UTC
(In reply to Andreas Schneider from comment #6)
Pushed to autobuild-v4-{7,6}-test.
Comment 8 Karolin Seeger 2017-11-22 08:14:27 UTC
(In reply to Karolin Seeger from comment #7)
Pushed to both branches.
Closing out bug report.

Thanks!