static int
internal_function
-__nss_group_nonlocal_lookup(service_user **ni, const char *fct_name,
- void **fctp)
+__nss_group_nonlocal_lookup2(service_user **ni, const char *fct_name,
+ const char *fct2_name, void **fctp)
{
if (__nss_group_nonlocal_database == NULL
&& __nss_database_lookup("group_nonlocal", NULL, NULL,
*ni = __nss_group_nonlocal_database;
*fctp = __nss_lookup_function(*ni, fct_name);
+ if (*fctp == NULL && fct2_name != NULL)
+ *fctp = __nss_lookup_function(*ni, fct2_name);
return 0;
}
char *buf;
size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
const struct walk_nss w = {
- .lookup = &__nss_group_lookup, .fct_name = "getgrgid_r",
+ .lookup2 = &__nss_group_lookup2, .fct_name = "getgrgid_r",
.status = &status, .errnop = errnop, .buf = &buf, .buflen = &buflen
};
const __typeof__(&_nss_nonlocal_getgrgid_r) self = &_nss_nonlocal_getgrgid_r;
enum nss_status status;
size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
const struct walk_nss w = {
- .lookup = &__nss_group_lookup, .fct_name = "getgrnam_r",
+ .lookup2 = &__nss_group_lookup2, .fct_name = "getgrnam_r",
.status = &status, .errnop = errnop, .buf = buffer, .buflen = &buflen
};
const __typeof__(&_nss_nonlocal_getgrnam_r) self = &_nss_nonlocal_getgrnam_r;
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = &__nss_group_nonlocal_lookup, .fct_name = "setgrent",
+ .lookup2 = &__nss_group_nonlocal_lookup2, .fct_name = "setgrent",
.status = &status
};
const __typeof__(&_nss_nonlocal_setgrent) self = NULL;
return status;
if (!grent_initialized) {
- __nss_group_nonlocal_lookup(&grent_startp, grent_fct_name,
- &grent_fct_start);
+ __nss_group_nonlocal_lookup2(&grent_startp, grent_fct_name, NULL,
+ &grent_fct_start);
__sync_synchronize();
grent_initialized = true;
}
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = &__nss_group_nonlocal_lookup, .fct_name = "endgrent",
+ .lookup2 = &__nss_group_nonlocal_lookup2, .fct_name = "endgrent",
.status = &status, .all_values = 1,
};
const __typeof__(&_nss_nonlocal_endgrent) self = NULL;
if (status == NSS_STATUS_SUCCESS)
return NSS_STATUS_SUCCESS;
- } while (__nss_next(&grent_nip, grent_fct_name, &grent_fct.ptr, status, 0) == 0);
+ } while (__nss_next2(&grent_nip, grent_fct_name, NULL, &grent_fct.ptr,
+ status, 0) == 0);
grent_nip = NULL;
return NSS_STATUS_NOTFOUND;
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = &__nss_group_nonlocal_lookup, .fct_name = "getgrnam_r",
+ .lookup2 = &__nss_group_nonlocal_lookup2, .fct_name = "getgrnam_r",
.status = &status, .errnop = errnop
};
const __typeof__(&_nss_nonlocal_getgrnam_r) self = NULL;
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = &__nss_group_nonlocal_lookup, .fct_name = "getgrgid_r",
+ .lookup2 = &__nss_group_nonlocal_lookup2, .fct_name = "getgrgid_r",
.status = &status, .errnop = errnop
};
const __typeof__(&_nss_nonlocal_getgrgid_r) self = NULL;
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = &__nss_group_nonlocal_lookup, .fct_name = "initgroups_dyn",
+ .lookup2 = &__nss_group_nonlocal_lookup2, .fct_name = "initgroups_dyn",
.status = &status, .all_values = 1, .errnop = errnop
};
const __typeof__(&_nss_nonlocal_initgroups_dyn) self = NULL;
static int
internal_function
-__nss_passwd_nonlocal_lookup(service_user **ni, const char *fct_name,
- void **fctp)
+__nss_passwd_nonlocal_lookup2(service_user **ni, const char *fct_name,
+ const char *fct2_name, void **fctp)
{
if (__nss_passwd_nonlocal_database == NULL
&& __nss_database_lookup("passwd_nonlocal", NULL, NULL,
*ni = __nss_passwd_nonlocal_database;
*fctp = __nss_lookup_function(*ni, fct_name);
+ if (*fctp == NULL && fct2_name != NULL)
+ *fctp = __nss_lookup_function(*ni, fct2_name);
return 0;
}
char *buf;
size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
const struct walk_nss w = {
- .lookup = &__nss_passwd_lookup, .fct_name = "getpwuid_r",
+ .lookup2 = &__nss_passwd_lookup2, .fct_name = "getpwuid_r",
.status = &status, .errnop = errnop, .buf = &buf, .buflen = &buflen
};
const __typeof__(&_nss_nonlocal_getpwuid_r) self = &_nss_nonlocal_getpwuid_r;
char *buf;
size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
const struct walk_nss w = {
- .lookup = __nss_passwd_lookup, .fct_name = "getpwnam_r",
+ .lookup2 = __nss_passwd_lookup2, .fct_name = "getpwnam_r",
.status = &status, .errnop = errnop, .buf = &buf, .buflen = &buflen
};
const __typeof__(&_nss_nonlocal_getpwnam_r) self = &_nss_nonlocal_getpwnam_r;
enum nss_status status;
size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
const struct walk_nss w = {
- .lookup = __nss_passwd_nonlocal_lookup, .fct_name = "getpwnam_r",
+ .lookup2 = __nss_passwd_nonlocal_lookup2, .fct_name = "getpwnam_r",
.status = &status, .errnop = errnop, .buf = buffer, .buflen = &buflen
};
const __typeof__(&_nss_nonlocal_getpwnam_r) self = NULL;
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = &__nss_passwd_nonlocal_lookup, .fct_name = "setpwent",
+ .lookup2 = &__nss_passwd_nonlocal_lookup2, .fct_name = "setpwent",
.status = &status
};
const __typeof__(&_nss_nonlocal_setpwent) self = NULL;
return status;
if (!pwent_initialized) {
- __nss_passwd_nonlocal_lookup(&pwent_startp, pwent_fct_name,
- &pwent_fct_start);
+ __nss_passwd_nonlocal_lookup2(&pwent_startp, pwent_fct_name, NULL,
+ &pwent_fct_start);
__sync_synchronize();
pwent_initialized = true;
}
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = &__nss_passwd_nonlocal_lookup, .fct_name = "endpwent",
+ .lookup2 = &__nss_passwd_nonlocal_lookup2, .fct_name = "endpwent",
.status = &status, .all_values = 1,
};
const __typeof__(&_nss_nonlocal_endpwent) self = NULL;
if (status == NSS_STATUS_SUCCESS)
return NSS_STATUS_SUCCESS;
- } while (__nss_next(&pwent_nip, pwent_fct_name, &pwent_fct.ptr, status, 0) == 0);
+ } while (__nss_next2(&pwent_nip, pwent_fct_name, 0, &pwent_fct.ptr, status,
+ 0) == 0);
pwent_nip = NULL;
return NSS_STATUS_NOTFOUND;
enum nss_status status;
int group_errno;
const struct walk_nss w = {
- .lookup = __nss_passwd_nonlocal_lookup, .fct_name = "getpwnam_r",
+ .lookup2 = __nss_passwd_nonlocal_lookup2, .fct_name = "getpwnam_r",
.status = &status, .errnop = errnop
};
const __typeof__(&_nss_nonlocal_getpwnam_r) self = NULL;
enum nss_status status;
int group_errno;
const struct walk_nss w = {
- .lookup = &__nss_passwd_nonlocal_lookup, .fct_name = "getpwuid_r",
+ .lookup2 = &__nss_passwd_nonlocal_lookup2, .fct_name = "getpwuid_r",
.status = &status, .errnop = errnop
};
const __typeof__(&_nss_nonlocal_getpwuid_r) self = NULL;
static int
internal_function
-__nss_shadow_nonlocal_lookup(service_user **ni, const char *fct_name,
- void **fctp)
+__nss_shadow_nonlocal_lookup2(service_user **ni, const char *fct_name,
+ const char *fct2_name, void **fctp)
{
if (__nss_shadow_nonlocal_database == NULL
&& __nss_database_lookup("shadow_nonlocal", NULL, NULL,
*ni = __nss_shadow_nonlocal_database;
*fctp = __nss_lookup_function(*ni, fct_name);
+ if (*fctp == NULL && fct2_name != NULL)
+ *fctp = __nss_lookup_function(*ni, fct2_name);
return 0;
}
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = &__nss_shadow_nonlocal_lookup, .fct_name = "setspent",
+ .lookup2 = &__nss_shadow_nonlocal_lookup2, .fct_name = "setspent",
.status = &status
};
const __typeof__(&_nss_nonlocal_setspent) self = NULL;
return status;
if (!spent_initialized) {
- __nss_shadow_nonlocal_lookup(&spent_startp, spent_fct_name,
- &spent_fct_start);
+ __nss_shadow_nonlocal_lookup2(&spent_startp, spent_fct_name, NULL,
+ &spent_fct_start);
__sync_synchronize();
spent_initialized = true;
}
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = &__nss_shadow_nonlocal_lookup, .fct_name = "endspent",
+ .lookup2 = &__nss_shadow_nonlocal_lookup2, .fct_name = "endspent",
.status = &status
};
const __typeof__(&_nss_nonlocal_endspent) self = NULL;
if (status == NSS_STATUS_SUCCESS)
return NSS_STATUS_SUCCESS;
- } while (__nss_next(&spent_nip, spent_fct_name, &spent_fct.ptr, status, 0) == 0);
+ } while (__nss_next2(&spent_nip, spent_fct_name, NULL, &spent_fct.ptr,
+ status, 0) == 0);
spent_nip = NULL;
return NSS_STATUS_NOTFOUND;
{
enum nss_status status;
const struct walk_nss w = {
- .lookup = __nss_shadow_nonlocal_lookup, .fct_name = "getspnam_r",
+ .lookup2 = __nss_shadow_nonlocal_lookup2, .fct_name = "getspnam_r",
.status = &status, .errnop = errnop
};
const __typeof__(&_nss_nonlocal_getspnam_r) self = NULL;
struct walk_nss {
enum nss_status *status;
int all_values;
- int (*lookup)(service_user **ni, const char *fct_name,
- void **fctp) internal_function;
+ int (*lookup2)(service_user **ni, const char *fct_name,
+ const char *fct2_name, void **fctp) internal_function;
const char *fct_name;
int *errnop;
char **buf;
/* glibc/nss/nsswitch.h */
typedef struct service_user service_user;
-extern int __nss_next (service_user **ni, const char *fct_name, void **fctp,
- int status, int all_values);
+extern int __nss_next2 (service_user **ni, const char *fct_name,
+ const char *fct2_name, void **fctp, int status,
+ int all_values);
extern int __nss_database_lookup (const char *database,
const char *alternative_name,
const char *defconfig, service_user **ni);
extern void *__nss_lookup_function (service_user *ni, const char *fct_name);
/* glibc/nss/XXX-lookup.c */
-extern int __nss_passwd_lookup (service_user **ni, const char *fct_name,
- void **fctp) internal_function;
-extern int __nss_group_lookup (service_user **ni, const char *fct_name,
- void **fctp) internal_function;
+extern int __nss_passwd_lookup2 (service_user **ni, const char *fct_name,
+ const char *fct2_name, void **fctp)
+ internal_function;
+extern int __nss_group_lookup2 (service_user **ni, const char *fct_name,
+ const char *fct2_name, void **fctp)
+ internal_function;
#endif /* NSSWITCH_INTERNAL_H */
int old_errno = errno;
if (!initialized) {
- if (w.lookup(&startp, w.fct_name, &fct_start) != 0) {
+ if (w.lookup2(&startp, w.fct_name, NULL, &fct_start) != 0) {
*w.status = NSS_STATUS_UNAVAIL;
goto walk_nss_out;
}
}
goto walk_nss_morebuf;
}
- } while (__nss_next(&nip, w.fct_name, &fct.ptr, *w.status, w.all_values) ==
- 0);
+ } while (__nss_next2(&nip, w.fct_name, NULL, &fct.ptr, *w.status,
+ w.all_values) == 0);
if (w.buf != NULL && *w.status != NSS_STATUS_SUCCESS) {
free(*w.buf);