Buffer limit on server listings.
Michael B Allen
mba2000 at ioplex.com
Sat Mar 27 05:58:42 GMT 2004
Rakesh Patel said:
> When using smbclient -L to list servers from a browse master, the list
> returned is not complete. Using "net view" under XP will return the full
> listing for large domains, however smbclient does not properly handle
> partial results as expected by the Windows environment.
Smbclient uses NetServerEnum RAP function which is limited to 64K of data.
XP is probably using the equivalent RPC call.
> I looked at the code and attempted to utilize cli_receive_trans to cause
> the next packet to be sent by the Windows browse master, but unfortunately
> it simply errors out. Adjusting buffer sizes seems to be a futile
> as the packet is complete and processed properly, however there are no
> examples of code in 3.0.2rc1 that check for a result code of ERRmoredata
> and actually processing the next data to be sent. Attempting to use
> cli_receive_trans and cli_send_trans proved futile.
It's not a RAP transaction limitation -- it's a browser protocol limit.
Either the NetrServerEnum RPC must be used or I hear there is a
NetServerEnum3 that can get the secondary buffers.
I'm not sure (someone will correct me if I'm wrong) but I beleive the
rpcclient utility can perform the NetrServerEnum call. Perhaps you can use
It would be a little smoother if smbclient/libsmbclient would just use the
appropriate call depending on wheather or not the server supports rpcs but
for some reason that doesn't appear to be the case.
More information about the samba-technical