it looks like the change landed for bug 16046 broke static dlopening of nss modules. if you try to use getaddrinfo/getpwnam/etc..., they just return errors immediately.
example tests:
$ cat test.c
#include <sys/types.h>
#include <pwd.h>
#include <stdio.h>
int main() {
void *p = getpwnam("root");
printf("%p\n", p);
return p == NULL ? 1 : 0;
}
it looks like the change landed for bug 16046 broke static dlopening of nss modules. if you try to use getaddrinfo/ getpwnam/ etc..., they just return errors immediately.
example tests:
$ cat test.c
#include <sys/types.h>
#include <pwd.h>
#include <stdio.h>
int main() {
void *p = getpwnam("root");
printf("%p\n", p);
return p == NULL ? 1 : 0;
}
$ gcc test.c && ./a.out
0x7f6aec59a0e0
$ gcc -static test.c && ./a.out
(nil)
$ cat test.c
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <net/if.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
int main(int argc, char *argv[])
{
const char *host = argv[1];
int rc;
struct addrinfo *result = NULL;
struct addrinfo hint;
rc = getaddrinfo(host, NULL, &hint, &result);
if (rc || !result) {
} else
}
$ gcc test.c && ./a.out localhost
$ gcc -static test.c && ./a.out localhost
bad address 'localhost'