Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 280541 Details for
Bug 375835
Enhance BinpkgFetcher to support SELinux
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
support selinux PORTAGE_FETCH_T in BinpkgFetcher
binpkg_selinux.patch (text/plain), 2.06 KB, created by
Zac Medico
on 2011-07-21 17:06:44 UTC
(
hide
)
Description:
support selinux PORTAGE_FETCH_T in BinpkgFetcher
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2011-07-21 17:06:44 UTC
Size:
2.06 KB
patch
obsolete
>From 1fbff8957c6de3654f7901e2ed4a075b972d06dc Mon Sep 17 00:00:00 2001 >From: Zac Medico <zmedico@gentoo.org> >Date: Thu, 21 Jul 2011 09:56:33 -0700 >Subject: [PATCH] BinpkgFetcher: support selinux PORTAGE_FETCH_T > >Thanks to Sven Vermeulen <sven.vermeulen@siphos.be> for the initial >patch posted on bug #375835. >--- > pym/_emerge/BinpkgFetcher.py | 2 ++ > pym/_emerge/SpawnProcess.py | 14 ++++++++++++-- > 2 files changed, 14 insertions(+), 2 deletions(-) > >diff --git a/pym/_emerge/BinpkgFetcher.py b/pym/_emerge/BinpkgFetcher.py >index 6c1dde9..baea4d6 100644 >--- a/pym/_emerge/BinpkgFetcher.py >+++ b/pym/_emerge/BinpkgFetcher.py >@@ -100,6 +100,8 @@ class BinpkgFetcher(SpawnProcess): > > self.args = fetch_args > self.env = fetch_env >+ if settings.selinux_enabled(): >+ self._selinux_type = settings["PORTAGE_FETCH_T"] > SpawnProcess._start(self) > > def _pipe(self, fd_pipes): >diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py >index bc861e9..b72971c 100644 >--- a/pym/_emerge/SpawnProcess.py >+++ b/pym/_emerge/SpawnProcess.py >@@ -8,6 +8,7 @@ import portage > from portage import _encodings > from portage import _unicode_encode > from portage import os >+from portage.const import BASH_BINARY > import fcntl > import errno > import gzip >@@ -25,7 +26,7 @@ class SpawnProcess(SubProcess): > "path_lookup", "pre_exec") > > __slots__ = ("args",) + \ >- _spawn_kwarg_names >+ _spawn_kwarg_names + ("_selinux_type",) > > _file_names = ("log", "process", "stdout") > _files_dict = slot_dict_class(_file_names, prefix="") >@@ -146,7 +147,16 @@ class SpawnProcess(SubProcess): > return os.pipe() > > def _spawn(self, args, **kwargs): >- return portage.process.spawn(args, **kwargs) >+ spawn_func = portage.process.spawn >+ >+ if self._selinux_type is not None: >+ spawn_func = portage.selinux.spawn_wrapper(spawn_func, >+ self._selinux_type) >+ # bash is an allowed entrypoint, while most binaries are not >+ if args[0] != BASH_BINARY: >+ args = [BASH_BINARY, "-c", "exec \"$@\"", args[0]] + args >+ >+ return spawn_func(args, **kwargs) > > def _output_handler(self, fd, event): > >-- >1.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 375835
:
280507
| 280541