Bug 8958 - smbclient sends incomplete hostname
Summary: smbclient sends incomplete hostname
Status: RESOLVED INVALID
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.6.5
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-29 09:25 UTC by Luk Claes
Modified: 2012-05-29 11:20 UTC (History)
1 user (show)

See Also:


Attachments
Wireshark dump of failing session (765 bytes, application/octet-stream)
2012-05-29 09:29 UTC, Luk Claes
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luk Claes 2012-05-29 09:25:44 UTC
When invoking:

smbclient -U lukclaes //shares1.ugent.be/test

I get the following response:

Enter lukclaes's password: 
session request to SHARES1.UGENT.BE failed (Not listening on called name)
Domain=[FILES] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
smb: \>

So it first fails, but tries again and that works.

In attachment the failing session: it sends 'SHARES1.UGENT.B<20>' as called name (note the missing E).
Comment 1 Volker Lendecke 2012-05-29 09:28:43 UTC
This is a NetBIOS protocol limitation, the called name can only have 15 characters plus service type. The real "bug" might be that we do not strip all but the non-qualified hostname. But that then will fail if the hostname is longer than 15 characters.
Comment 2 Luk Claes 2012-05-29 09:29:20 UTC
Created attachment 7601 [details]
Wireshark dump of failing session
Comment 3 Luk Claes 2012-05-29 09:32:10 UTC
(In reply to comment #1)
> This is a NetBIOS protocol limitation, the called name can only have 15
> characters plus service type. The real "bug" might be that we do not strip all
> but the non-qualified hostname. But that then will fail if the hostname is
> longer than 15 characters.

Right, for NetBIOS it would be better to strip the domain part from the hostname if it can only take 15 characters.
Comment 4 Stefan Metzmacher 2012-05-29 11:20:24 UTC
I think the only thing we could do, is to check if the name has more than 15 chars, and then fail the request to port 139 instead of truncating the name.