libsmbclient: how to see if authentication succeeded
Willem van Engen
dev-list-samba at willem.engen.nl
Mon May 26 18:18:31 GMT 2008
[repost at samba-technical@ instead of samba@]
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 there is 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
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).
I hope you'll be able to shed some light on this.
- Willem van Engen
More information about the samba-technical