suggestion for libsmbclient feature

Alexander Vodomerov alex at sectorb.msk.ru
Sat Jan 29 09:46:59 GMT 2005


   Hello!

I'm writing a file scanner that searches shares in SMB network
(http://sf.net/projects/fsmbsearch if it matters).

I would like to use libsmbclient to scan remote server. However, there
is a problem, that I cannot solve. Out network is quite large (more than
2000 hosts). There is no strong administration, so each user choose
whatever name for his computer. As a result, there many hosts have the
same names. To scan them, I've tried to use IP instead of name. It
works well for the most part of network. However, there are some old
machines running Win98 and this method doesn't work for them.
After googling I found that Win98 requires NetBIOS name to be specified:
http://lists.samba.org/archive/samba/2004-April/085175.html
http://www.spinics.net/lists/samba/msg33123.html

So, if I use only name I can't properly scan machines with the same
names. If I use only IP - I can't scan machines with Win98. The solution
is to use both! smbclient already allows to specify both name and IP
(via -I cmdline option). But the libsmbclient doesn't have such ability.
Functions like smbc_open get URL in form of //host/share or
//ip.ip.ip.ip/share, but not both.

I suggest adding this feature to libsmbclient. What is the best way to
specify ip? I've seen sources of the libsmbclient and found that there
are some "options". Currently supported options are "?mb=all",
"?mb=any". Maybe new option like "?ip=x.y.z.t" can be added? However,
with current code options and URL cannot be specified at the same time.
Another idea is to put this into SMBCCTX structure...

I can create a patch that add this functionality. What should be done
for it to be applied upstream? What coding style/policy/etc should I
follow? Do you see another solution for this problem?

PS. Sorry for my terrible English.
PPS. I posted this yesterday on general Samba mailing list, but nobody
replies. So I've tried here.

With best regards,
   Alexander.


More information about the samba-technical mailing list