dex4er / fakechroot

gives a fake chroot environment
GNU Lesser General Public License v2.1
295 stars 73 forks source link

system's passwd/group leaks into chrooted environment #41

Open johntconklin opened 8 years ago

johntconklin commented 8 years ago

At work, we've been using fakechroot+fakeroot for quite some time in a script to build a rootfs out of debian packages (similar to debootstrap).

We recently started adding postinst scriptlets to some of our packages to create users and/or groups when the packages are are installed, but this is not working reliably. For example, we've found that if the user or group already exists on the system, it is not added to the chroot's /etc/passwd or /etc/group files.

A simplified use-case to demonstrate the problem is 'fakechroot fakeroot chroot </path/to/chroot> getent passwd'. This doesn't output entries from the chroot's /etc/passwd file, instead it outputs entries from the system (including entries from NIS, even though the chroot's /etc/nsswitch.conf file is configured to only use the /etc/passwd file).

Our build servers are running Ubuntu 14.04. I've tried the system fakechroot, as well as one built from the current head of the master branch (f8dc2fcc10ee5fe64f7e619b7e55e455660dd78e).

sebunger commented 2 years ago

I just started having the exact same problem after upgrading to Ubuntu 22.04!