Browse List Mangling

Martin Sheppard martin.sheppard at
Thu Mar 29 06:52:11 GMT 2001

At 03:56 PM 29/03/2001 +1000, Tim Potter wrote:
>Martin Sheppard writes:
> > We are in the situation where we will end up consolidating over 5000
> > computers into a single Windows 2000 domain. As a result we will end up
> > with a a rather large browse list for this domain, which it will be no fun
> > using. I am working on a possible solution to this problem by setting 
> samba
> > up as a local master browser for the domain and getting it to alter the
> > browse lists that it serves out in various ways.
>Sounds neat!
> > Would a generic mechanism for doing browse list mangling be of interest to
> > other people?
>How do you handle locking of the browse.dat file?  Can smbd/nmbd
>try to read the file while it is being written by your perl

So far I haven't worried about locking and I haven't encountered a problem, 
but I would obviously want to have some sort of locking on the final 
version. Normally nmbd writes browse.dat for smbd to read. I have changed 
this so that nmbd writes browse.dat which is read by my perl daemon which 
then writes out browse.dax for smbd to read. I would probably choose a more 
sensible name in the final version. File locking can be achieved by writing 
the new file to a temporary location and replacing the file atomically with 
a rename operation. If smbd has the file open at the time, it will continue 
to see the old copy until it closes the file and reopens it.

>How about something like a 'browse list filter' hook that calls
>some program and returns yea or nay for adding a name or returns
>a modified name and type.

I suppose this would be possible, but to get it to work efficiently would 
be a little tricky - the results will have to be cached somehow for names 
we already know about. I think my current method is easier and more 
flexible, but I'll consider this sort of implementation.

I was thinking that eventually the program might have it's own 
configuration file. Something like:

         workgroup list = DOMAIN REMOTEDOM1 REMOTEDOM4

         ip =
         import DOMAIN: SALES-*, MARKETING-*
         import LOCALWG: *
         import static: SERVER1, SERVER2

         ip =
         import LOCALWG: *
         import static: SERVER1, SERVER3

This would make it spawn two copies of smbd and nmbd with appropriate 
smb.conf files and move entries between the browse lists as approprate. 
This sort of functionality is only in the conceptual stage at the moment.



More information about the samba-technical mailing list