From samba-technical Tue Oct 19 11:25:55 1999 From: Nicolas Brodu Date: Tue, 19 Oct 1999 11:25:55 +0000 To: samba-technical Subject: Re: sharing port with nmdb X-MARC-Message: https://marc.info/?l=samba-technical&m=94033235319035 Andrew Tridgell wrote: > > 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? > > indeed. It would break nmbd badly. It would also need root privileges! > > > 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. :) > > indeed it is, I think that is too complex. > > My plan instead is to have a small shared memory region (say 16k), > which would be used a a ring buffer and would hold any unexpected > messages that nmbd gets. Clients would then attach to this buffer > (which would be read-only to non-root processes) and could look for > packets having the correct opcode for replies they are expecting. Excellent! I wonder if the same idea could be used for other parts of the SMB protocol. For nmb lookup, this approach should be enough. But would it be possible by the same trick to send domain logon packets, and get the answer ? At present I'm looking for an alternative solution for my C++ library, (try to build the hierachy of masters on each subnet by broadcasting and asking NBNS, then log on each server), but it's a bit awkward. > > The nice thing about this is that it involves no extra sockets etc and > keeps the interaction between nmbd and nmblookup to a minimum. > Right. But maybe the jCIFS guys would prefer a socket based solution though... > I won't do this for 2.0.6, but maybe after that ;) > Cheers, Tridge -- Nicolas Brodu, brodun@aston.ac.uk, brodu@kde.org Student Engineer, 3rd year, at the IIE (Institut d'Informatique d'Entreprise) MSc by research at Aston University (Birmingham) http://www-eleves.iie.cnam.fr/brodu (libsmb)