Lines 5-12
Link Here
|
5 |
|
5 |
|
6 |
import atexit |
6 |
import atexit |
7 |
import errno |
7 |
import errno |
|
|
8 |
import fcntl |
8 |
import platform |
9 |
import platform |
9 |
import signal |
10 |
import signal |
|
|
11 |
import socket |
12 |
import struct |
10 |
import sys |
13 |
import sys |
11 |
import traceback |
14 |
import traceback |
12 |
import os as _os |
15 |
import os as _os |
Lines 439-444
def _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask,
Link Here
|
439 |
writemsg("Unable to unshare network: %s\n" % ( |
442 |
writemsg("Unable to unshare network: %s\n" % ( |
440 |
errno.errorcode.get(ctypes.get_errno(), '?')), |
443 |
errno.errorcode.get(ctypes.get_errno(), '?')), |
441 |
noiselevel=-1) |
444 |
noiselevel=-1) |
|
|
445 |
else: |
446 |
# 'up' the loopback |
447 |
IFF_UP = 0x1 |
448 |
ifreq = struct.pack('16sh', b'lo', IFF_UP) |
449 |
SIOCSIFFLAGS = 0x8914 |
450 |
|
451 |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0) |
452 |
try: |
453 |
fcntl.ioctl(sock, SIOCSIFFLAGS, ifreq) |
454 |
except IOError as e: |
455 |
writemsg("Unable to enable loopback interface: %s\n" % ( |
456 |
errno.errorcode.get(e.errno, '?')), |
457 |
noiselevel=-1) |
442 |
except AttributeError: |
458 |
except AttributeError: |
443 |
# unshare() not supported by libc |
459 |
# unshare() not supported by libc |
444 |
pass |
460 |
pass |
445 |
- |
|
|