Ignore:
Timestamp:
Jun 13, 2013, 6:01:30 AM (9 years ago)
Author:
andersk
Message:
Update nss_nonlocal to 2.1

- Support Automake 1.12.
- Guard one-time initialization with memory barriers.
- Make initgroups_dyn succeed when adding only magic groups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/common/oursrc/nss_nonlocal/nonlocal-passwd.c

    r1825 r2432  
    2626
    2727#define _GNU_SOURCE
     28
    2829#include <sys/types.h>
     30#include <dlfcn.h>
     31#include <errno.h>
     32#include <nss.h>
     33#include <pwd.h>
     34#include <stdbool.h>
     35#include <stddef.h>
     36#include <stdlib.h>
     37#include <string.h>
     38#include <syslog.h>
    2939#include <unistd.h>
    30 #include <stdlib.h>
    31 #include <stdint.h>
    32 #include <string.h>
    33 #include <dlfcn.h>
    34 #include <stdio.h>
    35 #include <syslog.h>
    36 #include <errno.h>
    37 #include <pwd.h>
    38 #include <grp.h>
    39 #include <nss.h>
     40
    4041#include "nsswitch-internal.h"
    4142#include "nonlocal.h"
     
    162163
    163164
     165static bool pwent_initialized = false;
    164166static service_user *pwent_startp, *pwent_nip;
    165167static void *pwent_fct_start;
     
    186188        return status;
    187189
    188     if (pwent_fct_start == NULL)
     190    if (!pwent_initialized) {
    189191        __nss_passwd_nonlocal_lookup(&pwent_startp, pwent_fct_name,
    190192                                     &pwent_fct_start);
     193        __sync_synchronize();
     194        pwent_initialized = true;
     195    }
    191196    pwent_nip = pwent_startp;
    192197    pwent_fct.ptr = pwent_fct_start;
     
    200205    const struct walk_nss w = {
    201206        .lookup = &__nss_passwd_nonlocal_lookup, .fct_name = "endpwent",
    202         .status = &status
     207        .status = &status, .all_values = 1,
    203208    };
    204209    const __typeof__(&_nss_nonlocal_endpwent) self = NULL;
Note: See TracChangeset for help on using the changeset viewer.