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;
}
+static bool pwent_initialized = false;
static service_user *pwent_startp, *pwent_nip;
static void *pwent_fct_start;
static union {
if (status != NSS_STATUS_SUCCESS)
return status;
- if (pwent_fct_start == NULL)
+ if (!pwent_initialized) {
__nss_passwd_nonlocal_lookup(&pwent_startp, pwent_fct_name,
&pwent_fct_start);
+ __sync_synchronize();
+ pwent_initialized = true;
+ }
pwent_nip = pwent_startp;
pwent_fct.ptr = pwent_fct_start;
return NSS_STATUS_SUCCESS;
}
+static bool spent_initialized = false;
static service_user *spent_startp, *spent_nip;
static void *spent_fct_start;
static union {
if (status != NSS_STATUS_SUCCESS)
return status;
- if (spent_fct_start == NULL)
+ if (!spent_initialized) {
__nss_shadow_nonlocal_lookup(&spent_startp, spent_fct_name,
&spent_fct_start);
+ __sync_synchronize();
+ spent_initialized = true;
+ }
spent_nip = spent_startp;
spent_fct.ptr = spent_fct_start;
return NSS_STATUS_SUCCESS;
*/
{
- static service_user *startp = NULL;
- static void *fct_start = NULL;
+ static bool initialized = false;
+ static service_user *startp;
+ static void *fct_start;
service_user *nip;
union {
} fct;
int old_errno = errno;
- if (fct_start == NULL &&
- w.lookup(&startp, w.fct_name, &fct_start) != 0) {
- *w.status = NSS_STATUS_UNAVAIL;
- goto walk_nss_out;
+ if (!initialized) {
+ if (w.lookup(&startp, w.fct_name, &fct_start) != 0) {
+ *w.status = NSS_STATUS_UNAVAIL;
+ goto walk_nss_out;
+ }
+ __sync_synchronize();
+ initialized = true;
}
nip = startp;