Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 375835 | Differences between
and this patch

Collapse All | Expand All

(-)a/pym/_emerge/BinpkgFetcher.py (+2 lines)
Lines 100-105 class BinpkgFetcher(SpawnProcess): Link Here
100
100
101
		self.args = fetch_args
101
		self.args = fetch_args
102
		self.env = fetch_env
102
		self.env = fetch_env
103
		if settings.selinux_enabled():
104
			self._selinux_type = settings["PORTAGE_FETCH_T"]
103
		SpawnProcess._start(self)
105
		SpawnProcess._start(self)
104
106
105
	def _pipe(self, fd_pipes):
107
	def _pipe(self, fd_pipes):
(-)a/pym/_emerge/SpawnProcess.py (-3 / +12 lines)
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
- 

Return to bug 375835