-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the GETAI operation #39
Conversation
9e18d44
to
e049ab1
Compare
e049ab1
to
826b458
Compare
826b458
to
e915b1b
Compare
We implement the GETAI (aka. get address info) operation. Most of the glibc applications will rely on this operation to perform the hostname -> addrs resolutions. We add some unit tests checking that we're correctly serializing the address info header and its payload. The expected data used in these tests has been extracted from various Nscd socket dumps. We also add an integration test checking that getaddrinfo is able to resolve localhost. The Nix crate we rely on for the glibc FFI bindings does not wrap getaddrinfo yet. We had to pull the `dns-lookup` package to get those bindings.
e915b1b
to
0669317
Compare
@NinjaTrappeur can you describe your manual test? I wonder if that's something we can get working in Actions. |
We use a NixOS VM test, using a custom version of getent. This test makes use of the fact that external glibc modules only work via nscd protocol on NixOS, and uses the nss-systemd module too. I'm not sure this will be something trivial to port to a container. We could add the VM test code to this repository, and tweak it so that it uses the nsncd code from here, but running it in GH actions might not work (nested virt). See https://github.com/flokli/nixpkgs/blob/e26519527879774b6a2551b1704598039cdbcb6e/nixos/tests/nscd.nix for the test code. |
On the actions front - you can reproduce the issue with Nix (nixpkgs) on a non-NixOS OS (in fact that's our use case). There is a host-wide libc, but Nix-built software doesn't use it. So I don't think we need NixOS specifically; we can just install Nix inside the actions VM running Ubuntu (or whatever) and make sure a |
Both this and #40 seem reasonable. Note that they both have to be merged in the same release because glibc's NSCD client disables lookups for the whole hosts family of operations if one operation comes back unimplemented (see also #26, where it disabled lookups for the whole groups family of operations), but that shouldn't be hard to do. I don't see any other host operations I think. I'd like to add an end-to-end test and we should sort out the CLA stuff (#44) but I'm actually curious to run this internally on my dev box (i.e. without yet writing config to let you disable this) and see how it holds up. I also want to stare a little bit harder at some of the Thank you for the contributions! |
Superseded by #49 |
We implement the GETAI (aka. get address info) operation. Most of the glibc applications will rely on this operation to perform the hostname -> addrs resolutions.
We add some unit tests checking that we're correctly serializing the address info header and its payload. The expected data used in these tests has been extracted from various Nscd socket dumps. We also add an integration test checking that getaddrinfo is able to resolve localhost.
The Nix crate we rely on for the glibc FFI bindings does not wrap getaddrinfo yet. We had to pull the
dns-lookup
package to get those bindings.Part of #37.
Note: on top of the automated tests, this PR has also been manually tested via a test VM.