Added native utilities to mount/umount/chroot via capabilities(7).

Three new helpers will now be installed into ${libexecdir}:
 - xbps-src-capchroot needs to have set CAP_SYS_CHROOT ep.
 - xbps-src-chroot-cap{,u}mount: needs to have set CAP_SYS_ADMIN ep.

That means that libcap and setcap(8) are now required to install
xbps-src and use it as normal user.

--HG--
extra : convert_revision : 586d6526079e085f86bf3e393459d429f6f0ef99
This commit is contained in:
Juan RP
2010-04-26 14:15:49 +02:00
parent 6673252679
commit e3dc3e3066
9 changed files with 293 additions and 34 deletions

View File

@@ -163,8 +163,14 @@ set_defvars
. $XBPS_SHUTILSDIR/common_funcs.sh
if [ -n "$XBPS_USE_CAPCHROOT" ]; then
chroot_cmd="@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-capchroot"
unset sudo_cmd
fi
if [ "$(id -u)" -eq 0 ]; then
# disable sudo and fakeroot if uid==0
chroot_cmd="chroot"
unset sudo_cmd
if [ -n "$in_chroot" ]; then
unset fakeroot_cmd
@@ -172,10 +178,6 @@ if [ "$(id -u)" -eq 0 ]; then
fi
fi
if [ -n "$XBPS_USE_CAPCHROOT" ]; then
chroot_cmd="capchroot"
fi
# Main switch
case "$target" in
build|configure)