Hi,
I noticed when using chroot's --userspec option the Gnulib's
parse_user_spec function gets called that leads the glibc to dlopen
libnss_compat.so.2 (probably getpwnam() that triggers the libc's NSS
mechanism). Since parse_user_spec is called after the chroot system call
the new root directory will be searched. I guess this means that the
chroot utility attempts to parse the user spec in the "guest"
environment. Is this behavior intended? In my case the chroot
environment contains a libnss_compat.so.2 that's not compatible and the
chroot utility fails with:
/usr/bin/chroot: relocation error: /lib/libnss_compat.so.2: symbol
_nss_files_parse_pwent, version GLIBC_2.0 not defined in file libc.so.6
with link time reference
As soon as I LD_PRELOAD libnss_compat.so.2 the "host" environment is
used to parse the user spec. If this is the intended behavior it would
be better if chroot calls the parse_user_spec prior issuing the chroot
syscall. Any thoughts? :)
Regards,
Ken
- chroot's userspec option Ken Werner
-