smbc_opendir() returns -1 but sets errno to 0

Richard Sharpe rsharpe at
Wed Nov 26 18:57:19 GMT 2003

On Wed, 26 Nov 2003, Stephan Kulow wrote:

> > Well... no, not really.  If there is a new election and some other node
> > becomes LMB then the cache would be invalid.  The real question is:  Why did
> > a query for smb://WORKGROUP_NAME/ return the IP address of something other
> > than a browser for the WORKGROUP_NAME workgroup?  Another question: Is it
> > possible that the workgroup browse list was, in fact, empty?  That can
> > happen fairly easily.
> > 
> > Ethereal... Your best friend.
> > 
> The issue is quite clear and I once discussed this problem already with Richard:
> The LMB is resolved through netbios and from the result only the host name is
> taken and then resolved over DNS - which can (as you say) result in a different
> IP. And when then the server behind the IP doesn't want the connection, then
> libsmbclient is confused and returns this strange -1, errno = 0 case (which
> resulted in the nice konqueror error "Unknown error: success" for quite 
> some time :)

Yes, this is an issue. I don't recall the discussion with Stephan but I 
believe that we discussed it. I can probably see where to fix this 
problem, though.
> libsmbclient needs to be changed to not resolve the name _again_ when it found
> out the master browser. Just noone got to that so far. And yes, that's an invalid
> network setup, but there are tons of reports for that - just one example:

Richard Sharpe, rsharpe[at], rsharpe[at], 

More information about the samba-technical mailing list