#!/usr/bin/env python2
import socket
import passfd
import tty
import signal
import sys
import pipes

s = socket.socket(socket.AF_UNIX)
s.connect('/hades/run/host/shell.socket')
args = sys.argv[1:]
if args:
    msg = 'exec ' + ' '.join(map(pipes.quote, args))
else:
    msg = 'interactive'
passfd.sendfd(s, 0, message=msg)

def send_resize(*_):
    s.sendall('R')

signal.signal(signal.SIGWINCH, send_resize)

while True:
    try:
        s.recv(4096)
        break
    except socket.error as err:
        if err.errno != 4:
            break

baeb5fad5714be37c8e6ca6013a923b82b9d5fc1
<mask token>


def send_resize(*_):
    s.sendall('R')


<mask token>

<mask token>
s.connect('/hades/run/host/shell.socket')
<mask token>
if args:
    msg = 'exec ' + ' '.join(map(pipes.quote, args))
else:
    msg = 'interactive'
passfd.sendfd(s, 0, message=msg)


def send_resize(*_):
    s.sendall('R')


signal.signal(signal.SIGWINCH, send_resize)
while True:
    try:
        s.recv(4096)
        break
    except socket.error as err:
        if err.errno != 4:
            break

<mask token>
s = socket.socket(socket.AF_UNIX)
s.connect('/hades/run/host/shell.socket')
args = sys.argv[1:]
if args:
    msg = 'exec ' + ' '.join(map(pipes.quote, args))
else:
    msg = 'interactive'
passfd.sendfd(s, 0, message=msg)


def send_resize(*_):
    s.sendall('R')


signal.signal(signal.SIGWINCH, send_resize)
while True:
    try:
        s.recv(4096)
        break
    except socket.error as err:
        if err.errno != 4:
            break

import socket
import passfd
import tty
import signal
import sys
import pipes
s = socket.socket(socket.AF_UNIX)
s.connect('/hades/run/host/shell.socket')
args = sys.argv[1:]
if args:
    msg = 'exec ' + ' '.join(map(pipes.quote, args))
else:
    msg = 'interactive'
passfd.sendfd(s, 0, message=msg)


def send_resize(*_):
    s.sendall('R')


signal.signal(signal.SIGWINCH, send_resize)
while True:
    try:
        s.recv(4096)
        break
    except socket.error as err:
        if err.errno != 4:
            break

#!/usr/bin/env python2
import socket
import passfd
import tty
import signal
import sys
import pipes

s = socket.socket(socket.AF_UNIX)
s.connect('/hades/run/host/shell.socket')
args = sys.argv[1:]
if args:
    msg = 'exec ' + ' '.join(map(pipes.quote, args))
else:
    msg = 'interactive'
passfd.sendfd(s, 0, message=msg)

def send_resize(*_):
    s.sendall('R')

signal.signal(signal.SIGWINCH, send_resize)

while True:
    try:
        s.recv(4096)
        break
    except socket.error as err:
        if err.errno != 4:
            break
