There was a problem where trying to bind .v4 and .v6 listeners would set them
to None if there was nothing to bind (if, say, you weren't binding an IPv6
listener). Later, the code then would try to call a member function of the
listener. The member function would not do anything if there was no listener,
but trying to dereference None yielded the broken behavior.
...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 gets rid of an extra intermediate sh process on the server that we were
keeping for no good reason, since it would exit as soon as python exited
anyway.
Someone on the mailing list reported getting these.
Also centralize the list of these errors, so we don't have different parts
of the code supporting a different subset of them. Now just use
ssnet.NET_ERRS.
For some reason, on Linux servers this returns EINVAL. I don't like just
treating EINVAL as non-fatal in general, so let's catch this specific case
and ignore it.
Reported by Reza Mohammadi on the mailing list. Interestingly, it's kind of
hard to trigger this crash since the client would have to request the
connection, and that connection shouldn't exist because the original client
program would have already gotten EINVAL. But my MacOS machine can generate
such a connection, so a MacOS->Linux sshuttle could trigger this.
A few people have reported that they have one or more invalid DNS servers in
/etc/resolv.conf, which they don't notice because the normal resolver
library just skips the broken ones. sshuttle would abort because it got an
unexpected socket error, which isn't so good.
Bug reported by Ed Maste. The fix in later versions of python is documented
here:
http://mail.python.org/pipermail/python-bugs-list/2006-August/034667.html
We're basically just doing the same thing when we see EINVAL. Note that
this doesn't happen on Linux because connect() is more forgiving.
So let's use %s instead of %r to print it, so that log messages can be more
useful. This only affects one message at debug3 for now, so it's not too
exciting.