v3 [PATCH 4/4] nsswitch: use new internal API
Siddhesh Poyarekar
siddhesh@gotplt.org
Wed Nov 4 07:30:17 GMT 2020
On 8/28/20 12:12 AM, DJ Delorie via Libc-alpha wrote:
>
> From 4b6ef844fe1ed39e8f9b8ffeb1dae51bdcbff32e Mon Sep 17 00:00:00 2001
> From: DJ Delorie <dj@redhat.com>
> Date: Tue, 23 Jun 2020 16:49:16 -0400
> Subject: [PATCH 4/4] nsswitch: use new internal API
>
> Stitch new ABI and types throughout all NSS callers and providers.
Could you split up the mechanical changes, i.e. the stitching of the new
ABI and the reloading code into separate patches? The patch is quite
large and I'm worried I'll miss out on some detail in the review process.
I did a quick run and found that tst-reload1 fails during make-check.
When run as part of the check, tst-reload1.out has:
error: tst-reload1.c:121: not true: p != NULL
error: tst-reload1.c:121: not true: p != NULL
error: tst-reload1.c:124: not true: strcmp (p->pw_name, pt[i].pw_name) == 0
error: tst-reload1.c:121: not true: p != NULL
error: tst-reload1.c:121: not true: p != NULL
error: tst-reload1.c:135: not true: strcmp (p->pw_name, pt[i].pw_name) == 0
error: tst-reload1.c:136: not true: p->pw_uid == pt[i].pw_uid
error: tst-reload1.c:136: not true: p->pw_uid == pt[i].pw_uid
error: tst-reload1.c:135: not true: strcmp (p->pw_name, pt[i].pw_name) == 0
error: tst-reload1.c:136: not true: p->pw_uid == pt[i].pw_uid
error: tst-reload1.c:132: not true: p != NULL
error: tst-reload1.c:132: not true: p != NULL
error: tst-reload1.c:144: not true: h != NULL
error: tst-reload1.c:144: not true: h != NULL
error: tst-reload1.c:144: not true: h != NULL
Didn't expect signal from child: got `Segmentation fault'
Also, git-am reported a couple of whitespace warnings, one of them is
this and the other is in tst-reload1.c.
> + for (size_t idx = 0; idx < nhost_data; ++idx)
> + if (memcmp (host_data[idx].h_addr, addr, len) == 0)
> + return copy_host (result, & host_data[idx], buffer, buflen, h_errnop);
> +
Trailing whitespace here.
> + return NSS_STATUS_NOTFOUND;
> +}
> +
> +/* Note: only the first address is supported, intentionally. */
> +enum nss_status
> +NAME(gethostbyaddr_r) (const void *addr, socklen_t len, int af,
> + struct hostent *result, char *buffer, size_t buflen,
> + int *errnop, int *h_errnop)
> +{
> + return NAME(gethostbyaddr2_r) (addr, len, af, result, buffer, buflen,
> + errnop, h_errnop, NULL);
> +}
> diff --git a/nss/nsswitch.c b/nss/nsswitch.c
> index 8d7b69d4bc..9b73296c5f 100644
> --- a/nss/nsswitch.c
> +++ b/nss/nsswitch.c
A lot of these changes along with the bits in nss_module.c to add
monitoring could become a separate patch to replace legacy parsing with
the infrastructure implemented in 1-3/4. The mechanical changes could
then be a separate change. That way the actual stitching bits could get
closer review focus given that they're not mixed in with the mechanical
changes.
Thanks,
Siddhesh
More information about the Libc-alpha
mailing list