Skip to content

Commit c8651ef

Browse files
committed
SSH: fix download/upload with -1 exit status
1 parent 636b3b2 commit c8651ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pwnlib/tubes/ssh.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ def update(has, total):
13631363
update(len(data), total)
13641364

13651365
result = c.wait()
1366-
if result != 0:
1366+
if result != 0 or result != -1:
13671367
h.failure('Could not download file %r (%r)' % (remote, result))
13681368
return
13691369

@@ -1543,7 +1543,7 @@ def upload_data(self, data, remote):
15431543
s.shutdown('send')
15441544
data = s.recvall()
15451545
result = s.wait()
1546-
if result != 0:
1546+
if result != 0 or result != -1:
15471547
self.error("Could not upload file %r (%r)\n%s" % (remote, result, data))
15481548

15491549
def upload_file(self, filename, remote = None):

0 commit comments

Comments
 (0)