Calling winbind from C/C++

Tim Potter tpot at
Wed Oct 17 01:12:28 GMT 2001

Mike Papper writes:

> I have downloaded and compile and installed the samba 2.2.2
> with winbind. I have created a C program that acts like (my
> own) version of wbinfo - it calls
> winbindd_request(WINBINDD_LIST_USERS, NULL, &response)
> and links with libsmbclient and libnss_winbind. This actually works, I am 
> able to talk to the winbind server to get a list of users on the "system".
> However, this does not work when I try to use it in a C++
> program. When I include nsswitch/winbindd.h
> nsswitch/winbindd_nss.h etc. I get compile errors complaining
> about uses of "new" and "class" (which extern "C" doesnt deal
> with).

There are no occurences of "new" or "class" in any of the header
files in nsswitch.  Can you be a bit more precise about the error
you are getting here?

I (or someone) really needs to write a much nicer client
interface to winbind that you can link in to your funky programs
without having to pull in too many header files and so on.  It's
a bit ad-hoc at the moment.

> The questions:
> -should I be able to use winbind to talk to the windbind server? It appears 


> that the functions in libsmbclient do not do what I want at all (they open 
> files and create dirs). I know I can call getpwent to get a list of users - 

libsmbclient and winbind should be completely separate
libraries.  I don't think the interact at all.


More information about the samba mailing list