Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 356324 Details for
Bug 481450
sys-apps/portage: FEATURES=network-sandbox to unshare() networking in ebuilds
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
4. Enable loopback after unshare()
0004-Enable-the-loopback-interface-after-unsharing-networ.patch (text/plain), 1.37 KB, created by
Michał Górny
on 2013-08-17 20:17:10 UTC
(
hide
)
Description:
4. Enable loopback after unshare()
Filename:
MIME Type:
Creator:
Michał Górny
Created:
2013-08-17 20:17:10 UTC
Size:
1.37 KB
patch
obsolete
>From d399f691bdad19723cbfa2d5f1e5d6979ed2bc11 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> >Date: Sat, 17 Aug 2013 22:05:52 +0200 >Subject: [PATCH 4/4] Enable the loopback interface after unsharing network. > >--- > pym/portage/process.py | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/pym/portage/process.py b/pym/portage/process.py >index 0cebba7..a7464c7 100644 >--- a/pym/portage/process.py >+++ b/pym/portage/process.py >@@ -5,8 +5,11 @@ > > import atexit > import errno >+import fcntl > import platform > import signal >+import socket >+import struct > import sys > import traceback > import os as _os >@@ -439,6 +442,19 @@ def _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask, > writemsg("Unable to unshare network: %s\n" % ( > errno.errorcode.get(ctypes.get_errno(), '?')), > noiselevel=-1) >+ else: >+ # 'up' the loopback >+ IFF_UP = 0x1 >+ ifreq = struct.pack('16sh', b'lo', IFF_UP) >+ SIOCSIFFLAGS = 0x8914 >+ >+ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) >+ try: >+ fcntl.ioctl(sock, SIOCSIFFLAGS, ifreq) >+ except IOError as e: >+ writemsg("Unable to enable loopback interface: %s\n" % ( >+ errno.errorcode.get(e.errno, '?')), >+ noiselevel=-1) > except AttributeError: > # unshare() not supported by libc > pass >-- >1.8.3.2 >
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 481450
:
356282
|
356320
|
356322
| 356324