Calling winbind from C/C++

Mike Papper mike at
Tue Oct 16 21:01:34 GMT 2001

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 

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 - 
but I was having fun working with winbind directly.

Mike Papper
Digital Pipe
mike at
650-627-5100 ext. 5211

More information about the samba mailing list