I cannot reproduce this problem.
Firstly, the bind-libbind package provides the BIND 8 resolver library
for applications that specifically require it, not as the system default
resolver.
Unless you specifically require use of the BIND resolver, use the system
resolver.
The system resolver is in glibc; you use it automatically with this compile:
# gcc -o a a.c
See man resolver(3)
Only the system resolver uses /etc/nsswitch.conf; libbind uses
/etc/irs.conf (see man libbind-irs.conf).
In order to use libbind, you need to include the headers in
/usr/include/bind BEFORE the system headers, and link with
libbind BEFORE glibc - ie. :
---
#include <bind/irs.h>
#include <bind/resolv.h>
#include <bind/arpa/inet.h>
#include <bind/arpa/nameser.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
main()
{
struct passwd *p;
p = getpwuid(25);
if (p != NULL)
printf("%s\n",p -> pw_name);
exit (0);
}
---
This works fine on my system for local users:
# gcc -o a a.c -lbind
# ./a
named
You'd need to configure /etc/irs.conf to retrieve information about NIS,
NISPLUS, LDAP, or Hesiod users.
If you require to use the libbind library, and after having followed the
above steps to pick up the correct includes, and having configured irs.conf
if you need to resolve non-local users, you still have a problem, please
re-open this bug; I'm closing it as NOTABUG since I cannot reproduce it
with correct use of the libbind library.

Note

You need to
log in
before you can comment on or make changes to this bug.