*/
#define _GNU_SOURCE
+
#include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
#include <dlfcn.h>
-#include <stdio.h>
-#include <syslog.h>
#include <errno.h>
-#include <pwd.h>
#include <grp.h>
#include <nss.h>
+#include <pwd.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+
#include "nsswitch-internal.h"
#include "nonlocal.h"
return status;
}
+static bool grent_initialized = false;
static service_user *grent_startp, *grent_nip;
static void *grent_fct_start;
static union {
if (status != NSS_STATUS_SUCCESS)
return status;
- if (grent_fct_start == NULL)
+ if (!grent_initialized) {
__nss_group_nonlocal_lookup(&grent_startp, grent_fct_name,
&grent_fct_start);
+ __sync_synchronize();
+ grent_initialized = true;
+ }
grent_nip = grent_startp;
grent_fct.ptr = grent_fct_start;
return NSS_STATUS_SUCCESS;