libsmbclient and smb_opendir: problem with workgroup

Derrell.Lipman at UnwiredUniverse.com Derrell.Lipman at UnwiredUniverse.com
Mon Jun 14 20:12:55 GMT 2004


Andreas <andreas at conectiva.com.br> writes:

>> The smb:// form is supposed to collect the list of workgroups.  The 
>
> See, this is what got me confused. I didn't realize that the group I'm in
> could affect this result if it had a non-working server. I just tought some
> sort of broadcast would be used to get a list of all workgroups.

Yup, that's what Chris' and my discussion has been about.  The code is
"broken" (well, ok, "not behaving as one [such as you] might expect") because
if the master browser associated with your default workgroup doesn't have for
some reason, or wont provide, the list of workgroups, you'll get a failure
indication.  This can happen because the master browser associated with your
default workgroup has been up and running for less than 12 minutes (longer in
certain circumstances); or if as in your case, that master browser is either
misconfigured or otherwise not responding to the query.

My fix, which it seems Chris likes (just not the way I implemented it) solves
this problem by querying all of the discovered master browsers for their list
of workgroups and merging the responses into a single coherent list.  In 3-4
weeks, it sounds like I'll be reworking that code, probably making my solution
the "default".  Once that's done, your current request for the list of
workgroups would succeed.  Until then, you can either temporarily change the
application to call smbc_opendir("smb://?mb=.all"), or just wait.  Keep in
mind that if you make the above change, it will likely be broken after my mods
based on Chris' and others' input are completed.

Derrell




More information about the samba-technical mailing list