sharing port with nmdb

Stephen Langasek vorlon at netexpress.net
Mon Oct 18 23:58:32 GMT 1999


On Mon, 18 Oct 1999 Laurent.Boulard at eleve.emn.fr wrote:

> So, I needed to listen to broadcast and unicast udp packet on port 137
> and 138. I had to listen to port 137 because W95 send answer to name
> resolution always on this port (it's s..k a lot).
> With the help of option SOCK_REUSEADDR, every thing was fine (I stayed
> near nmbd whitout disturbing it) but came the new version of the kernel
> ..

> Try as root to do 'nmblookup -r -A IpOfWindows95Computer'. It works with
> 2.0 kernel but not with new 2.2 serie (2.2.12 for me actually). Why ?
> The developpers of the kernel made the (security) choice of not allowing
> a process to listen to socket of other. I think it's a good idea but
> there are programs that use the ability of shared socket between
> process.

If I understand how SOCK_REUSEADDR works, I think there would still be
problems with the wrong application reading in a packet, wouldn't there?
Also, SOCK_REUSEADDR doesn't solve the problem for non-root users, who still
can't perform netbios queries for Win9x machines, even though there is
nothing 'privileged' about this information.

Therefore, I suggest an alternate solution.  Using Unix sockets, or
something similar, support could be added to nmbd so that other applications
(e.g., nmblookup) could ask nmbd to send a query for them.
Of course, the devil's in the details. :)

-Steve Langasek
postmodern programmer



More information about the samba-technical mailing list