Latest libsmbclient.so changes committed etc

Richard Sharpe sharpe at ns.aus.com
Mon Feb 19 09:47:28 GMT 2001


At 09:16 AM 2/19/01 +0100, Simo Sorce wrote:
>On Mon, 19 Feb 2001, Richard Sharpe wrote:
>
>> Hi
>>
>> I have committed some more changes to libsmbclient.
>>
>> The big change is that I have determined that WinNT and Win2K, and I
>> presume, Win9X, all behave incorrectly[1] with respect to UDP messages to
>> ports 137 and 138.
>>
>> When a UDP datagram is sent to a Windows system, say on port 138, Windows
>> responds to port 138 on the sending system, regardless of what the source
>> port was in the datagram.
>>
>> This creates problems for libsmbclient, as it is unlikely to be running as
>> root, and even if it were, if Samba is running on the same machine,
>> libsmbclient will not be able to gain access to port 138.
>>
>> Thus a different mechanism is needed to gain access to responses to
>> GetBackupList requests and to Registration requests.
>>
>> Rather than exploring different approaches (which may be what nmblookup and
>> smbclient do in certain situations), I have stuck with using GetBackupList
>> requests and have made use of a feature in nmbd that makes unexpected
>> packets available to other processes via the unexpected packet TDB.
>>
>> The problem with this approach is that it requires Samba to be on the Linux
>> system if you are working in an environment containing NT, Win2K or Win9X
>> systems.
>>
>> However, it seems that there may be a simpler approach that is worth
>> exploring that will allow us to avoid the reliance on Samba/nmbd. So, I
>> will spend some time looking at this.
>>
>> A quick check shows that name lookups for <DOMAIN><1D>, the Local Master
>> Browser address, for example, returns to a non-privileged port and gives us
>> an IP address to deal with.
>>
>> Since for Win9X systems (possibly only Win95) we will need the NetBIOS name
>> of the server, as it does not accept connections on *SMBSERVER, we may need
>> to do an NBSTAT call on the name <DOMAIN><1D> which returns quite a lot of
>> info ...
>>
>>
>> [1] Seems lots of people agree with me here ...
>>
>
>Does this mean you does not ever need to use GetBackupList Registration
>because an nbstat against <DOMAIN><1D> will retrun enough info?

Well, yes. Technically, you are supposed to contact a backup browse server,
which you identify with a GetBackupList request, but the browse master
(local master browser) will serve the info as well.

If we find we overload the browse master too much, we may have to look at
this issue again, but Microsoft has not been helpful in the way they
respond to a GetBackupList request. Their approach of responding to
privileged ports for these requests is surprising given that they respond
correctly to a NameQuery and NBSTAT request.

>--
>Simo Sorce - Linux Systems Consultant
>E-mail: simo.sorce at polimi.it
>Tel: +39 0348 7149179 - Fax: +39 02 700442399
>-----------------------------------------------------------------
>Be happy, use Linux!
>
>
>

Regards
-------
Richard Sharpe, sharpe at ns.aus.com
Samba (Team member, www.samba.org), Ethereal (Team member, www.ethereal.com)
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba






More information about the samba-technical mailing list