summaryrefslogtreecommitdiffstats
path: root/sshuttle/methods/ipfw.py
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2019-11-09 01:27:57 +0100
committerBrian May <brian@linuxpenguins.xyz>2019-11-09 11:27:57 +1100
commit6ad4473c87511bcafaec3d8d0c69dfcb166b48ed (patch)
treed386d00ace1f20b38259fceea990a08e7f85e822 /sshuttle/methods/ipfw.py
parent23516ebd71d6518f30a3cfadbe424481c2c13cab (diff)
Make hostwatch locale-independent (#379)
* Make hostwatch locale-independent See #377: hostwatch used to call netstat and parse the result, without setting the locale. The problem is converting the binary output to a unicode string, as the locale may be utf-8, latin-1, or literally anything. Setting the locale to C avoids this issue, as netstat's source strings to not use non-ASCII characters. * Break line, check all other invocations
Diffstat (limited to 'sshuttle/methods/ipfw.py')
-rw-r--r--sshuttle/methods/ipfw.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sshuttle/methods/ipfw.py b/sshuttle/methods/ipfw.py
index 1549822..53e8ac6 100644
--- a/sshuttle/methods/ipfw.py
+++ b/sshuttle/methods/ipfw.py
@@ -106,6 +106,7 @@ def _sysctl_set(name, val):
argv = ['sysctl', '-w', '%s=%s' % (name, val)]
debug1('>> %s\n' % ' '.join(argv))
return ssubprocess.call(argv, stdout=open(os.devnull, 'w'))
+ # No env: No output. (Or error that won't be parsed.)
_changedctls = []
@@ -139,6 +140,7 @@ def ipfw(*args):
argv = ['ipfw', '-q'] + list(args)
debug1('>> %s\n' % ' '.join(argv))
rv = ssubprocess.call(argv)
+ # No env: No output. (Or error that won't be parsed.)
if rv:
raise Fatal('%r returned %d' % (argv, rv))
@@ -147,6 +149,7 @@ def ipfw_noexit(*args):
argv = ['ipfw', '-q'] + list(args)
debug1('>> %s\n' % ' '.join(argv))
ssubprocess.call(argv)
+ # No env: No output. (Or error that won't be parsed.)
class Method(BaseMethod):