Lines 562-567
def _exec(binary, mycommand, opt_name, fd_pipes,
Link Here
|
562 |
@return: Never returns (calls os.execve) |
562 |
@return: Never returns (calls os.execve) |
563 |
""" |
563 |
""" |
564 |
|
564 |
|
|
|
565 |
sandbox_enabled = binary is SANDBOX_BINARY |
566 |
effective_uid = -1 if uid is None else uid |
567 |
effective_gid = -1 if gid is None else gid |
568 |
|
565 |
# If the process we're creating hasn't been given a name |
569 |
# If the process we're creating hasn't been given a name |
566 |
# assign it the name of the executable. |
570 |
# assign it the name of the executable. |
567 |
if not opt_name: |
571 |
if not opt_name: |
Lines 703-708
def _exec(binary, mycommand, opt_name, fd_pipes,
Link Here
|
703 |
writemsg("Unable to mount new /proc: %d\n" % (mount_ret,), |
707 |
writemsg("Unable to mount new /proc: %d\n" % (mount_ret,), |
704 |
noiselevel=-1) |
708 |
noiselevel=-1) |
705 |
os._exit(1) |
709 |
os._exit(1) |
|
|
710 |
|
711 |
if sandbox_enabled: |
712 |
# Create a private /var/log/sandbox since the pid namespace |
713 |
# triggers log file name collision with a process in another |
714 |
# pid namespace with the same pid. |
715 |
portage_builddir = env.get('PORTAGE_BUILDDIR') |
716 |
if portage_builddir is not None: |
717 |
sandbox_log_dir = os.path.join(portage_builddir, 'sandbox_log') |
718 |
global_log_dir = '/var/log/sandbox' |
719 |
portage.util.ensure_dirs(global_log_dir) |
720 |
portage.util.ensure_dirs(sandbox_log_dir, |
721 |
uid=effective_uid, gid=effective_gid) |
722 |
s = subprocess.Popen(['mount', |
723 |
'--bind', sandbox_log_dir, global_log_dir]) |
724 |
mount_ret = s.wait() |
725 |
if mount_ret != 0: |
726 |
writemsg("Unable to mount %s: %d\n" % (global_log_dir, mount_ret,), |
727 |
noiselevel=-1) |
728 |
os._exit(1) |
729 |
|
706 |
if unshare_net: |
730 |
if unshare_net: |
707 |
_configure_loopback_interface() |
731 |
_configure_loopback_interface() |
708 |
except AttributeError: |
732 |
except AttributeError: |
709 |
- |
|
|