mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-02-03 12:09:34 +01:00
Insert two binary NUL bytes (\0) before SSHUTTLE0001 sync string.
...and search for those null bytes before looking for the sync string. This helps when people have misconfigured .bashrc to print messages even in non-interactive mode. (On my Debian Lenny system, .bashrc doesn't seem to run when you do 'ssh localhost ls', but on MacOS servers, it does. Hmm...)
This commit is contained in:
parent
65b0390fe9
commit
7712c60c36
@ -198,7 +198,14 @@ def _main(listener, fw, ssh_cmd, remotename, python, latency_control,
|
||||
handlers.append(mux)
|
||||
|
||||
expected = 'SSHUTTLE0001'
|
||||
|
||||
try:
|
||||
v = 'x'
|
||||
while v and v != '\0':
|
||||
v = serversock.recv(1)
|
||||
v = 'x'
|
||||
while v and v != '\0':
|
||||
v = serversock.recv(1)
|
||||
initstring = serversock.recv(len(expected))
|
||||
except socket.error, e:
|
||||
if e.args[0] == errno.ECONNRESET:
|
||||
|
Loading…
Reference in New Issue
Block a user