[gnutls-devel] GnuTLS | init_fds test fails inside user namespace (#1125)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Thu Nov 26 09:33:08 CET 2020

Ryan Burns created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1125

## Description of problem:
`init_fds` test fails when run inside of a [nix-user-chroot](https://github.com/nix-community/nix-user-chroot) user namespaced environment.

Maybe the user namespace changes the way fds are assigned, or occupies some slots so the new ones are not at index 3?

I'm also not sure whether this is a property of Linux user namespaces in general, or something that nix-user-chroot is doing in particular.

FAIL: init_fds

doit:59: could not open fd, or OS doesn't assign fds in a serial way (-1)
FAIL init_fds (exit status: 1)

Relevant test section:

## Version of gnutls used:

(But should apply to any version with `init_fds` test, as it hasn't been modified since it was introduced)

## Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)
Nixpkgs unstable x86_64-linux

## To reproduce:
Install Nix as a non-root user following nix-user-chroot's [installation instructions](https://github.com/nix-community/nix-user-chroot#installation).

Inside the user chroot, run:
nix-build '<nixpkgs>' -A gnutls --check # check flag forces local rebuild+test

## Expected/Actual Behavior
The build/test command passes on
* NixOS 
* non-NixOS with multi-user Nix installation (root daemon builders)
* non-NixOS with single-user Nix installation (non-root, with user-owned /nix)

But fails on
* non-NixOS with Nix via nix-user-chroot (non-root, user-owned folder user namespace mounted to /nix)

Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1125
You're receiving this email because of your account on gitlab.com.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20201126/2e20654a/attachment.html>

More information about the Gnutls-devel mailing list