Bug 8139 - smbclient fails if server does not support Echo request
Summary: smbclient fails if server does not support Echo request
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.5.6
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 20:27 UTC by Debian samba package maintainers (PUBLIC MAILING LIST)
Modified: 2012-02-03 19:22 UTC (History)
1 user (show)

See Also:


Attachments
Packet capture with the SMB echo packet and the response by the Apple Time Capsule (284 bytes, application/octet-stream)
2012-01-30 19:35 UTC, Matthias Scheler
no flags Details
Patch to fix problems between "smbclient" and CIFS 4.32 (657 bytes, patch)
2012-01-30 19:37 UTC, Matthias Scheler
no flags Details
git-am fix for 3.5.next (1.16 KB, patch)
2012-01-30 21:56 UTC, Jeremy Allison
metze: review-
Details
Patches for master (2.52 KB, patch)
2012-01-31 07:51 UTC, Stefan Metzmacher
jra: review+
Details
git-am fix for both 3.5.next and 3.6.next. (1.08 KB, patch)
2012-01-31 18:04 UTC, Jeremy Allison
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debian samba package maintainers (PUBLIC MAILING LIST) 2011-05-16 20:27:23 UTC
This is Debian bug #611834:

smbclient fails to work on a server not supporting the Echo request.
Old samba versions that does not support this request are still used for
example in SLES 10.

| $ smbclient //smb.example.org/VOL2
| Enter blank's password:
| session request to SMB failed (Called name not present)
| Domain=[JURA] OS=[SUSE LINUX 10.1] Server=[SUSE LINUX 10.1]
| smb: \> SMBecho failed. Maybe server has closed the connection
| $
Comment 1 Jeremy Allison 2011-05-16 23:56:25 UTC
Exactly what Samba version is this ? Even versions as far back as 3.0.x support SMBecho...

Jeremy.
Comment 2 Debian samba package maintainers (PUBLIC MAILING LIST) 2011-05-17 06:25:52 UTC
That was samba 3.5.6. I'll try to ping the original bug submitter as he might be of more help, having the test case handy

-- 
Christian
Comment 3 Volker Lendecke 2011-05-17 14:12:45 UTC
Please also upload a network trace of the failure. Information on how to create useful network traces can be found under

http://wiki.samba.org/index.php/Capture_Packets

Thanks
Comment 4 Matthias Scheler 2012-01-30 19:34:02 UTC
I've got the same problem with an Apple Time Capsule that is not running Samba:

Domain=[ZHADUM] OS=[Apple Base Station] Server=[CIFS 4.32]
smb: \backups\> SMBecho failed. Maybe server has closed the connection

The problem is simply caused by the fact that it doesn't support the SMBecho request.
Comment 5 Matthias Scheler 2012-01-30 19:35:22 UTC
Created attachment 7267 [details]
Packet capture with the SMB echo packet and the response by the Apple Time Capsule

This packet capture contains the SMB echo packet and the response.
Comment 6 Matthias Scheler 2012-01-30 19:37:26 UTC
Created attachment 7268 [details]
Patch to fix problems between "smbclient" and CIFS 4.32

This patch fixes the problem for me by simply ignoring the error reported by the Time Capsule. The SMB echo will still serve the purpose of keeping the connection open in this case.
Comment 7 Jeremy Allison 2012-01-30 19:37:52 UTC
Wow - so it sets the NT_STATUS_ERROR code flag in flags2, then returns an invalid NT STATUS code of 0xFFFF0002. That's messed up.

Jeremy.
Comment 8 Jeremy Allison 2012-01-30 19:52:58 UTC
Probably we should change this code to terminate the connection only if we get a well known socket error or timeout detected.

Jeremy.
Comment 9 Jeremy Allison 2012-01-30 21:56:16 UTC
Created attachment 7269 [details]
git-am fix for 3.5.next

Matthias - can you confirm this fix works for you ?

Jeremy.
Comment 10 Matthias Scheler 2012-01-30 23:17:23 UTC
Yes, this fix works for me. I can establish a connection to the Time Capsule and download a file without problems (and with excellent performance).
Comment 11 Jeremy Allison 2012-01-30 23:53:32 UTC
Comment on attachment 7269 [details]
git-am fix for 3.5.next

This git-am fix also applies to 3.6.next.

Submitter has verified it fixes the problem.

Jeremy.
Comment 12 Stefan Metzmacher 2012-01-31 07:33:40 UTC
Comment on attachment 7269 [details]
git-am fix for 3.5.next

I think we should just check
cli_state_is_connected() after cli_echo().
There're more error codes possible than just 3.
Comment 13 Stefan Metzmacher 2012-01-31 07:51:27 UTC
Created attachment 7273 [details]
Patches for master

Jeremy, I think this is a better fix.
Comment 14 Jeremy Allison 2012-01-31 18:04:06 UTC
Comment on attachment 7273 [details]
Patches for master

Pushed to master.
Comment 15 Jeremy Allison 2012-01-31 18:04:45 UTC
Created attachment 7274 [details]
git-am fix for both 3.5.next and 3.6.next.

Back-port of Metze's patch for 3.5.next and 3.6.next.
Comment 16 Stefan Metzmacher 2012-02-01 07:17:18 UTC
Comment on attachment 7274 [details]
git-am fix for both 3.5.next and 3.6.next.

looks good
Comment 17 Stefan Metzmacher 2012-02-01 07:17:54 UTC
Karolin, please for the next releases
Comment 18 Karolin Seeger 2012-02-03 19:22:41 UTC
Pushed to both branches.
Closing out bug report.

Thanks!