fakechroot icon indicating copy to clipboard operation
fakechroot copied to clipboard

getpwnam (and others) fail with glibc >= 2.32

Open josch opened this issue 2 years ago • 0 comments

Hi,

Starting with glibc 2.32 the compat nss module for getpwnam calls __nss_files_fopen (which is a GLIBC_PRIVATE symbol provided by glibc) instead of fopen (see 299210c1fa67e2dfb564475986fce11cd33db9ad in glibc). This leads to getpwnam calls accessing /etc/passwd from outside the chroot and as a result programs like adduser do not work correctly anymore under fakechroot.

Relevant bug for the Debian fakechroot package: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993946

Even if glibc changes to use fopen in the future, fakechroot will be broken for all glibc versions until then. One way to work around this would be to wrap __nss_files_fopen in fakechroot.

josch avatar Sep 09 '21 15:09 josch