Hi Jochen,

Quoting Jochen Sprickerhof (2021-01-05 23:48:35)
> on a freshly installed Debian unstable:
> 
> $ sudo apt install sbuild mmdebstrap
> $ sbuild-createchroot --debootstrap=mmdebstrap \
>     --make-sbuild-tarball ~/.cache/sbuild/unstable-amd64.tar.gz \
>     unstable $(mktemp -d)  # according to man mmdebstrap
> I: SUITE: unstable
> I: TARGET: /tmp/tmp.eLWAANve3b
> I: MIRROR: http://deb.debian.org/debian
> I: Running mmdebstrap --arch=amd64 --variant=buildd --verbose 
> --include=fakeroot,build-essential --components=main --resolve-deps 
> --no-merged-usr unstable /tmp/tmp.eLWAANve3b http://deb.debian.org/debian
> I: the option --resolve-deps is a no-op. It only exists for compatibility 
> with some debootstrap wrappers.
> I: the option --no-merged-usr is a no-op. It only exists for compatibility 
> with some debootstrap wrappers.
> I: automatically chosen mode: unshare
> I: chroot architecture amd64 is equal to the host's architecture
> I: automatically chosen format: directory
> I: running apt-get update...
> [...]
> I: cleaning package lists and apt cache...
> Reading package lists...
> I: success in 38.6073 seconds
> E: failed running setup script: cannot open /etc/passwd at (eval 20) line 1, 
> <PH> line 1.
> 
> I guess this is due to the unshare mode, whereas sbuild-createchroot
> tries to modify <TMPDIR>/etc/passwd as the normal user:
> 
> $ ll /tmp/tmp.eLWAANve3b/etc/passwd
> -rw-r--r-- 1 100000 100000 922  5. Jan 23:40 /tmp/tmp.eLWAANve3b/etc/passwd
> 

yes, you correctly identified the reason and this has to be fixed. Until then,
you can use this workaround:

    $ sbuild-createchroot --chroot-mode=unshare --make-sbuild-tarball 
~/.cache/sbuild/unstable-amd64.tar.gz unstable $(mktemp -d)

The reason you probably are seeing this is, that you maybe recently upgraded
your kernel to 5.10.1 or later? Because with that version, usernamespaces were
enabled by default. Before, the command that you saw in the mmdebstrap man page
would be executed with fakechroot/fakeroot and thus not expose this bug. :)

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to