Skip to content

Avoid controlling pty if no pty is being used

Michal Čihař requested to merge nijel/proxy:nopty into master

Fixes following error:

2018-01-16T13:16:00+0100 [SSHChannel session (0) on SSHService b'ssh-connection' on SSHServerTransport,21,118.186.36.50] Unhandled Error
        Traceback (most recent call last):
          File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 86, in callWithContext
            return context.call({ILogContext: newCtx}, func, *args, **kw)
          File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 118, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 81, in callWithContext
            return func(*args,**kw)
          File "/usr/lib/python3/dist-packages/twisted/conch/ssh/channel.py", line 162, in requestReceived
            return f(data)
        --- <exception caught here> ---
          File "/usr/lib/python3/dist-packages/twisted/conch/ssh/session.py", line 58, in request_shell
            self.session.openShell(pp)
          File "/usr/lib/python3/dist-packages/haas_proxy/proxy.py", line 136, in openShell
            fcntl.ioctl(self.pty.fileno(), tty.TIOCSWINSZ, struct.pack('4H', *self.winSize))
        builtins.AttributeError: 'Process' object has no attribute 'fileno'

Merge request reports