Lines 8-13
import portage
Link Here
|
8 |
from portage import _encodings |
8 |
from portage import _encodings |
9 |
from portage import _unicode_encode |
9 |
from portage import _unicode_encode |
10 |
from portage import os |
10 |
from portage import os |
|
|
11 |
from portage.const import BASH_BINARY |
11 |
import fcntl |
12 |
import fcntl |
12 |
import errno |
13 |
import errno |
13 |
import gzip |
14 |
import gzip |
Lines 25-31
class SpawnProcess(SubProcess):
Link Here
|
25 |
"path_lookup", "pre_exec") |
26 |
"path_lookup", "pre_exec") |
26 |
|
27 |
|
27 |
__slots__ = ("args",) + \ |
28 |
__slots__ = ("args",) + \ |
28 |
_spawn_kwarg_names |
29 |
_spawn_kwarg_names + ("_selinux_type",) |
29 |
|
30 |
|
30 |
_file_names = ("log", "process", "stdout") |
31 |
_file_names = ("log", "process", "stdout") |
31 |
_files_dict = slot_dict_class(_file_names, prefix="") |
32 |
_files_dict = slot_dict_class(_file_names, prefix="") |
Lines 146-152
class SpawnProcess(SubProcess):
Link Here
|
146 |
return os.pipe() |
147 |
return os.pipe() |
147 |
|
148 |
|
148 |
def _spawn(self, args, **kwargs): |
149 |
def _spawn(self, args, **kwargs): |
149 |
return portage.process.spawn(args, **kwargs) |
150 |
spawn_func = portage.process.spawn |
|
|
151 |
|
152 |
if self._selinux_type is not None: |
153 |
spawn_func = portage.selinux.spawn_wrapper(spawn_func, |
154 |
self._selinux_type) |
155 |
# bash is an allowed entrypoint, while most binaries are not |
156 |
if args[0] != BASH_BINARY: |
157 |
args = [BASH_BINARY, "-c", "exec \"$@\"", args[0]] + args |
158 |
|
159 |
return spawn_func(args, **kwargs) |
150 |
|
160 |
|
151 |
def _output_handler(self, fd, event): |
161 |
def _output_handler(self, fd, event): |
152 |
|
162 |
|
153 |
- |
|
|