Skip to content

Commit

Permalink
Merge branch 'stable' into zachriggle-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
zachriggle committed Jan 28, 2019
2 parents 19eed57 + 39dd2c3 commit afa7753
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pwnlib/tubes/ssh.py
Expand Up @@ -146,13 +146,17 @@ def recvall(self, timeout = sock.forever):
# However, we need to wait for the return value to propagate,
# which may not happen by the time .close() is called by tube.recvall()
tmp_sock = self.sock
tmp_close = self.close
self.close = lambda: None

timeout = self.maximum if self.timeout is self.forever else self.timeout
data = super(ssh_channel, self).recvall(timeout)

# Restore self.sock to be able to call wait()
self.close = tmp_close
self.sock = tmp_sock
self.wait()
self.close()

# Again set self.sock to None
self.sock = None
Expand Down

0 comments on commit afa7753

Please sign in to comment.