libsmbclient: parsing of domain/workgroup in smbc_parse_path not performed.

Richard Sharpe rsharpe at
Mon Feb 9 14:07:15 GMT 2004

On Mon, 9 Feb 2004, Lautier, Marc wrote:

> I'm currently working on some customization of the libsmbclient.
> I noticed that the smbc_parse_path function, which is supposed to decode
> URLs with the format:
> 	smb://[[[domain;]user[:password]@]server[/share[/path[/file]]]]
> does in fact totally ignore the domain field.
> Instead from being parsed from the URL (when present), that information
> seems to be copied directly from the context workgroup field, or the
> authentication function.
> Is there is specific reason NOT to retrieve that information from the URL
> when it is present ?

Probably that I forgot to do that properly when I wrote the code.
> I've made myself a customized libsmbclient.c where smbc_parse_path decode
> and return that information when it is present. When returning from
> smbc_parse_path, I then proccess is username : if not empty, I used the
> parsed value, otherwise I copy the workgroup from the context.
> That appear to be working for me so far, but I have nothing approaching an
> adequate testing environment for that kind of change.

Hmmm, you should check the draft (or it it official now) RFC on URL syntax 
before we can commit this code.
> As a side note, I've added two entry point to my customized libsmbclient :
> int smbc_sid_to_name(const char *server_URL, const char *sid, char *value,
> size_t size);
> int smbc_name_to_sid(const char *server_URL, const char *name, char *value,
> size_t size);
> These two calls will open the IPC$$ pipe on the server designated by
> server_URL (share, path an filname ignored), an attempt to resolve an SID
> into a User Name, or the opposit.
> Would that be a suitable official extension to libsmbclient ?

They seem useful. I would be interested in looking at them, but will wait 
for feedback on whether or not they should be committed.

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

More information about the samba-technical mailing list