Changeset 2432 for trunk/server/common/oursrc/nss_nonlocal/nonlocal-group.c
- Timestamp:
- Jun 13, 2013, 6:01:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/common/oursrc/nss_nonlocal/nonlocal-group.c
r1825 r2432 25 25 26 26 #define _GNU_SOURCE 27 27 28 #include <sys/types.h> 28 #include <unistd.h>29 #include <stdlib.h>30 #include <stdint.h>31 #include <string.h>32 29 #include <dlfcn.h> 33 #include <stdio.h>34 #include <syslog.h>35 30 #include <errno.h> 36 #include <pwd.h>37 31 #include <grp.h> 38 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> 39 #include <unistd.h> 40 39 41 #include "nsswitch-internal.h" 40 42 #include "nonlocal.h" … … 170 172 } 171 173 174 static bool grent_initialized = false; 172 175 static service_user *grent_startp, *grent_nip; 173 176 static void *grent_fct_start; … … 194 197 return status; 195 198 196 if ( grent_fct_start == NULL)199 if (!grent_initialized) { 197 200 __nss_group_nonlocal_lookup(&grent_startp, grent_fct_name, 198 201 &grent_fct_start); 202 __sync_synchronize(); 203 grent_initialized = true; 204 } 199 205 grent_nip = grent_startp; 200 206 grent_fct.ptr = grent_fct_start; … … 208 214 const struct walk_nss w = { 209 215 .lookup = &__nss_group_nonlocal_lookup, .fct_name = "endgrent", 210 .status = &status 216 .status = &status, .all_values = 1, 211 217 }; 212 218 const __typeof__(&_nss_nonlocal_endgrent) self = NULL; … … 356 362 const struct walk_nss w = { 357 363 .lookup = &__nss_group_nonlocal_lookup, .fct_name = "initgroups_dyn", 358 .status = &status, . errnop = errnop364 .status = &status, .all_values = 1, .errnop = errnop 359 365 }; 360 366 const __typeof__(&_nss_nonlocal_initgroups_dyn) self = NULL; … … 445 451 #include "walk_nss.h" 446 452 #undef args 447 if (status != NSS_STATUS_SUCCESS) 453 if (status == NSS_STATUS_NOTFOUND || status == NSS_STATUS_UNAVAIL) 454 return NSS_STATUS_SUCCESS; 455 else if (status != NSS_STATUS_SUCCESS) 448 456 return status; 449 457
Note: See TracChangeset
for help on using the changeset viewer.