Proposal: libsmbclient API

Derrell Lipman derrell.lipman at unwireduniverse.com
Thu Mar 26 16:33:12 GMT 2009


On Thu, Mar 26, 2009 at 11:53 AM, Andreas Schneider <mail at cynapses.org>wrote:

> On Tuesday 24 March 2009 15:39:46 Derrell Lipman wrote:
> > Well the samba3 portion of master isn't changing, and needs to retain
> > backwards compatibility. I think we can solve all of these issues,
> though,
> > by having this be the beginnings of a samba4 libsmbclient. A libsmbclient
> > for samba4 will have a much cleaner interface to the internals, due to
> the
> > benefit of 20-20-hindsight of some of the troubles in samba3 leading
> > towards a very clean interface design from the outset.  It can, as well,
> > address (remove!) many of the historical dependencies that samba3's
> > libsmbclient has had to live with.
>
> So, what's the plan for libsmbclient now? Leave how it is, add setter and
> getter for errno and try to make it thread safe the way it is (if
> possible)?
>
>
I haven't gone back over all of the code recently to see what, if anything,
remains other than the errno issues. Other than in libsmb_compat (the POSIX
compatibility layer), I don't believe there are any global variables or
anything else (other than errno) that should prevent libsmbclient from being
thread-safe, but the library really needs a thorough inspection to ensure
that.

To start with, yes, I think it would be a good idea to add the
smbc_[sg]et_errno() function (which sets errno to the specified value for
backward compatibility in addition to storing it in the private area of the
context) and change libsmb_*.c to call smbc_set_errno() instead of assigning
to errno itself.

That should be a pretty trivial task. I'm preoccupied with some unrelated
stuff right now, but if you would like to provide a patch (ideally with
git-format-patch) with this change, I'll review and then commit it. Sound
like a way to get started?

Thanks for your continued interest in this!

Derrell


More information about the samba-technical mailing list