NetServerEnum2 from libsmbclient on port 445.

Brenden Bain bainey at pcpro.net.au
Tue Apr 8 07:00:23 GMT 2003


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.



More information about the samba-technical mailing list