aboutsummaryrefslogtreecommitdiff
path: root/nss/getXXbyYY_r.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2020-11-09 22:09:34 -0500
committerDJ Delorie <dj@redhat.com>2020-12-04 17:16:32 -0500
commitf4f3b09111e9fa38fd485979a3e40b6cfa6a757d (patch)
treef2743a776f31b86ebebc9f145dd1305bade66eef /nss/getXXbyYY_r.c
parent6eceded941bb6dcc097291757e2aef5cd7212133 (diff)
downloadglibc-f4f3b09111e9fa38fd485979a3e40b6cfa6a757d.zip
glibc-f4f3b09111e9fa38fd485979a3e40b6cfa6a757d.tar.gz
glibc-f4f3b09111e9fa38fd485979a3e40b6cfa6a757d.tar.bz2
nsswitch: use new internal API (callers)
Stitch new ABI and types throughout all NSS callers. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'nss/getXXbyYY_r.c')
-rw-r--r--nss/getXXbyYY_r.c51
1 files changed, 5 insertions, 46 deletions
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index e8c9ab1..6c287a6 100644
--- a/nss/getXXbyYY_r.c
+++ b/nss/getXXbyYY_r.c
@@ -179,7 +179,7 @@ typedef enum nss_status (*lookup_function) (ADD_PARAMS, LOOKUP_TYPE *, char *,
EXTRA_PARAMS);
/* The lookup function for the first entry of this service. */
-extern int DB_LOOKUP_FCT (service_user **nip, const char *name,
+extern int DB_LOOKUP_FCT (nss_action_list *nip, const char *name,
const char *name2, void **fctp);
libc_hidden_proto (DB_LOOKUP_FCT)
@@ -189,10 +189,7 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
size_t buflen, LOOKUP_TYPE **result H_ERRNO_PARM
EXTRA_PARAMS)
{
- static bool startp_initialized;
- static service_user *startp;
- static lookup_function start_fct;
- service_user *nip;
+ nss_action_list nip;
int do_merge = 0;
LOOKUP_TYPE mergegrp;
char *mergebuf = NULL;
@@ -227,6 +224,7 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
PREPROCESS;
#endif
+
#ifdef HANDLE_DIGITS_DOTS
switch (__nss_hostname_digits_dots (name, resbuf, &buffer, NULL,
buflen, result, &status, AF_VAL,
@@ -264,47 +262,8 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
}
#endif
- if (! startp_initialized)
- {
- no_more = DB_LOOKUP_FCT (&nip, REENTRANT_NAME_STRING,
- REENTRANT2_NAME_STRING, &fct.ptr);
- if (no_more)
- {
- void *tmp_ptr = (service_user *) -1l;
-#ifdef PTR_MANGLE
- PTR_MANGLE (tmp_ptr);
-#endif
- startp = tmp_ptr;
- }
- else
- {
- void *tmp_ptr = fct.l;
-#ifdef PTR_MANGLE
- PTR_MANGLE (tmp_ptr);
-#endif
- start_fct = tmp_ptr;
- tmp_ptr = nip;
-#ifdef PTR_MANGLE
- PTR_MANGLE (tmp_ptr);
-#endif
- startp = tmp_ptr;
- }
-
- /* Make sure start_fct and startp are written before
- startp_initialized. */
- atomic_write_barrier ();
- startp_initialized = true;
- }
- else
- {
- fct.l = start_fct;
- nip = startp;
-#ifdef PTR_DEMANGLE
- PTR_DEMANGLE (fct.l);
- PTR_DEMANGLE (nip);
-#endif
- no_more = nip == (service_user *) -1l;
- }
+ no_more = DB_LOOKUP_FCT (&nip, REENTRANT_NAME_STRING,
+ REENTRANT2_NAME_STRING, &fct.ptr);
while (no_more == 0)
{