NetServerEnum2 from libsmbclient on port 445.

Christopher R. Hertel crh at ubiqx.mn.org
Tue Apr 8 07:19:23 GMT 2003


Hmmm, yeah...

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.

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)?

Chris -)-----

Brenden Bain wrote:
> 
> Hi all,
> 
> I was doing some coding with 'libsmbclient' and found an interesting problem.
> Our network consists of win2k, winXP, win9x, MacOS bunched into workgroups
> (i.e. no win2k or NT domains). When I used libsmbclient to retrieve a list of
> computers in a workgroup (e.g URL of smb://workgroup) the
> following situations occurred:
> 
> 1. the the NetServerEnum2 request was sent to the workgroup's LMB on port 445
> and a valid reply was returned, but was empty even though the workgroup is
> not.
> 
> 2. the the NetServerEnum2 request was sent to the workgroup's LMB on port 445
> and a valid reply was returned that listed the workgroup correctly.
> 
> 3. the the NetServerEnum2 request was sent to the workgroup's LMB on port 139
> and a valid reply was returned that listed the workgroup correctly.
> 
> On the other hand, when I use smbclient situtation 3 always occurs, even when
> it has the option of sending SMB over raw TCP. Why does this happen ?  Can I
> fix it by just altering libsmbclient to always connect to 137, or is there a
> reason it tries to connect to 445 ?
> 
> Another interesting point is that NetShareEnum works no matter which port it
> is sent to. Here are some specs
> 
>   Linux Slackware 9.0
>   Samba 2.2.8 (from Slackware)
>   Standard config, except that 'security = share'
>   Kernel 2.4.20.
> 
> Thanks in advance,
> 
> Brenden.

-- 
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the samba-technical mailing list