[proof of concept] libwbclient.so

James Peach jorgar at gmail.com
Thu Aug 30 15:25:32 GMT 2007


On 29/08/2007, Gerald (Jerry) Carter <jerry at samba.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Folks,
>
> Attached is a very basic POC of how to build a libwbclient.so
> which can be linked into application for accessing the
> winbindd API.  I've only included the lookupname() call
>
>   $ gcc -o wbinfo-test main.c -lwbclient
>
>   $ ./wbinfo AD gcarter
>   S-1-5-21-3234968684-14787312-124015166-3136 (1)
>
> The goal is to remove the tight coupling between smbd and
> winbindd so that Winbind can be developed independently
> of smbd.  Currently smbd is hard coded to a specific
> WINBIND_INTERFACE_VERSION.  What I'm doing is to allow
> smbd to link against a library that carries that dependency
> instead.  So that if you need to upgrade winbindd, as long
> as the libwbclient maintains a compatible API, one can
> replace winbindd without having to upgrade or recompile
> smbd as well.

I like the idea. Some comments about the API ....

I don't much like having the API allocate strings for all the SIDs. If
you defined a binary SID type, callers would only have to allocate
when they called wbcSidToString().

The SUCCESS/FAIL values of wbcStatus are OK, but if you are going to
make wbcStatus more detailed I'd suggest renaming WBC_FAIL to
WBC_UNKNOWN_ERROR or something.

I can't tell what name_type means by looking at this code, but it
feels like it should be an enum.

this API should be in nsswitch, not in winbind :)

-- 
James Peach | jorgar at gmail.com


More information about the samba-technical mailing list