[Samba] libsmbclient: how to see if authentication succeeded

Willem van Engen dev-list-samba at willem.engen.nl
Sat May 17 08:32:37 GMT 2008


I'm looking for a way in libsmbclient to see if authentication
succeeded or not. Not finding libsmbclient documentation except
examples, I started looking at code and found some doing a trivial
operation (stat on a known-readable path for example). However, in my
case I have no guarenteed-readable directory or file.

I did find a workaround though, but it's a bit of a kludge that may
break in a future libsmbclient release if internals are changed.
libsmbclient calls user-supplied functions to handle connection caches
and adds an item only if a connection succeeded. So in this way I can
see if just the authentication worked out, independent of the
operation's result (like stat). But as it's a kludge, I'd like to find a
better approach.

So my question is: did I miss something in the API, or could an addition
be made to check authentication? The latter could be done by introducing
another return value for authentication-failed, or exposing the
login-function (which would remain optional to call, as it is now).

Kind regards,
- Willem van Engen

More information about the samba mailing list