abuild rootbld: disable real chown calls in fakeroot

By default, fakeroot forwards chown system calls to the libc and ignores
EPERM errors. Unfortunately, when fakeroot is used inside a restricted
bubblewrap environment, bubblewrap intercepts these system calls and
returns EINVAL. The EINVAL return value is not masked by fakeroot and
returned to the caller, thereby causing failures of mv(1), install(1),
chown(1), … which use the chown system calls internally.

Setting the FAKEROOTDONTTRYCHOWN environment variable prevents the chown
systemcalls to be performed in the first place. This variable is only
set in the environment created through bubblewrap by abuild rootbld.

Fixes #10021
This commit is contained in:
Sören Tempel 2020-12-21 22:00:19 +01:00
parent b78073f663
commit 3665a7a994
1 changed files with 1 additions and 0 deletions

View File

@ -2363,6 +2363,7 @@ rootbld() {
--hostname "build-$buildhost-$CARCH" \
--chdir "$startdir" \
--setenv PATH ${USE_CCACHE:+/usr/lib/ccache/bin:}/bin:/usr/bin:/sbin:/usr/sbin \
--setenv FAKEROOTDONTTRYCHOWN 1 \
/usr/bin/abuild $force rootbld_actions
update_abuildrepo_index
cleanup $CLEANUP