FreeBSD winbind support is broken: as compiled, the nss_winbind.so module is
missing the actual winbind symbols which perform the getpwnam/getgrent/etc
functions. winbind_nss_freebsd.c is not intended as a replacement but as a
wrapper around the Linux code. It still needs the functions in
winbind_nss_linux.c.
To observe the bug:
1) Compile and install the nss_winbind.so module, and edit nsswitch.conf to
use winbind.
2) Use pw showuser [DOMAIN USER], smbd, etc. Winbind clearly does not work,
and you'll get messages similar to the following in the debug syslog facility:
NSSWITCH(nss_method_lookup): winbind, group, setgrent, not found
NSSWITCH(nss_method_lookup): winbind, group, getgrent_r, not found
NSSWITCH(nss_method_lookup): winbind, group, endgrent, not found
...ad infinitum.
Attached is a tiny patch to Samba's configure script to fix the problem. After
you recompile and reinstall libnss_winbind.so (as nss_winbind.so in /usr/lib)
it works and the messages cease.