NetServerEnum2 from libsmbclient on port 445.
Stephan Kulow
coolo at kde.org
Tue Apr 8 12:03:31 GMT 2003
On Tuesday 08 April 2003 13:39, Brenden Bain wrote:
> Hi,
>
> > This is an interesting area of study. The NetServerEnum2() function
> > call is supposed to return a list of NetBIOS names. SMB on port 445
> > is NetBIOS-less SMB. In theory, it makes some sort of sense that a
> > NetServerEnum2() call via port 445 would not return any NetBIOS server
> > names.
>
> That seems to make sense.
>
> > My gut, though, is that the LMB was recently elected and had not had
> > time to rebuild the Browse List. Can you verify that for me (one way
> > or the other)?
>
> I'm quite sure the LMB is up-to-date. If I first try to get the workgroup list
> using libsmbclient I get am empty NetServerEnum2 reply. If I then call
> smbclient -L on the LMB, then the NetServerEnum2 reply contains all the
> computers in the workgroup. Also if I put a block on all TCP connections
> leaving from port 445, to force libsmbclient to try port 139, then I get a
> NetServerEnum2 reply with all the computers in the workgroup. As smbclient
> always uses 139 I would assume that the connection to 445 causes the error.
> This problem can be replicated on win2k and win2000. I am not sure about
> win9x, but as they do not reply to 445 they should not have the same problem.
>
> At the same time there is at least one winXP system where the NetServerEnum2
> reply is vaild when the request is sent to port 445. Maybe this is a
> configuration option, service release, or my mistake ?
>
Indeed. When I force port 139 then I can browse just fine. Will try to fine tune that ;)
Greetings, Stephan
--- libsmb//libsmbclient.c 6 Apr 2003 17:22:41 -0000 1.73
+++ libsmb//libsmbclient.c 8 Apr 2003 12:02:35 -0000
@@ -446,6 +446,7 @@ SMBCSRV *smbc_server(SMBCCTX *context,
}
c.timeout = context->timeout;
+ c.port = 139;
if (!cli_connect(&c, server_n, &ip)) {
cli_shutdown(&c);
More information about the samba-technical
mailing list