[Samba] BINGO - bug - 3.0.14, 3.0.21 intractable browsing problems

Jeremy Allison jra at samba.org
Tue Jan 31 04:23:32 GMT 2006


On Mon, Jan 30, 2006 at 08:08:52PM -0700, Stephen Bosch wrote:
> Okay, folks -- we've found the cause of the problem.
> 
> To recap: With our Samba server as the master browser, the domain window
> in My Network Places is totally empty, irrespective of what client we
> use (Windows 98, 2000, XP).
> 
> When Samba is not the master browser (i.e., another workstation is
> acting as the master browser), hosts are visible.
> 
> When Samba is the master browser, the browse.dat and wins.dat files are
> populated correctly with the hosts on the network.
> 
> Our browse.dat and wins.dat files are stored in /var/cache/samba.
> 
> The directory had permissions of 744. With the permission set as 744, no
> worky. With the permissions set at 755, tada -- suddenly it works. A
> whole host of problems are resolved. A permissions problem (what we
> initially suspected) but not one that was simple to devine. The browse
> connections are made by an unprivileged user, and with permissions of
> 744, that user cannot enter the directory, even if the files are readable.
> 
> This is the sort of problem that a perusal of the nmbd log should have
> made immediately obvious. If Samba can't read a vital file, shouldn't it
> be reporting that in the logs? We've reproduced the problem with the log
> level set at 9; though nmbd reports that the browse.dat file is being
> written to, it never says anything about being unable to read it or
> unable to enter the cache directory. If it had, we would have taken
> three minutes to fix this problem instead of three weeks.
> 
> We didn't see an error to this effect in the session logs, either.
> 
> Perhaps there's something misconfigured with our logging -- but it seems
> just as likely that Samba isn't reporting a failure to read the
> browse.dat and wins.dat files to the logs.

Hmmm, here's the failed to read wins.dat file message :

        if((fp = x_fopen(lock_path(WINS_LIST),O_RDONLY,0)) == NULL) {
                DEBUG(2,("initialise_wins: Can't open wins database file %s. Error was %s\n",
                        WINS_LIST, strerror(errno) ));
                return True;
        }

That should probably be a debug level 0 - I'll fix that in
the code for 3.0.22.

Here's the browse.dat message from smbd:

  lines = file_lines_load(lock_path(SERVER_LIST), NULL);
  if (!lines) {
    DEBUG(4,("Can't open %s - %s\n",lock_path(SERVER_LIST),strerror(errno)));
    return(0);
  }

Ouch ! Level 4..... This may have been your underlying problem. nmbd
may have been able to write this but smbd may not have been able
to read it given the connected user.

but from nmbd :

        fp = x_fopen(fnamenew,O_WRONLY|O_CREAT|O_TRUNC, 0644);

        if (!fp) {
                DEBUG(0,("write_browse_list: Can't open file %s. Error was %s\n",
                        fnamenew,strerror(errno)));
                return;
        }

So you should have seen a meesage from nmbd - it's logging at a
debug level 0.

Jeremy.


More information about the samba mailing list