Latest libsmbclient.so changes committed etc

Richard Sharpe sharpe at ns.aus.com
Mon Feb 19 04:26:49 GMT 2001


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 ...

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