Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
f3cbc501
Commit
f3cbc501
authored
Apr 30, 2016
by
Brian May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PEP8 issues
parent
e73e797f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
9 deletions
+13
-9
conf.orig.py
docs/conf.orig.py
+1
-1
cmdline.py
sshuttle/cmdline.py
+2
-1
helpers.py
sshuttle/helpers.py
+1
-0
hostwatch.py
sshuttle/hostwatch.py
+3
-3
ssh.py
sshuttle/ssh.py
+1
-0
ssnet.py
sshuttle/ssnet.py
+5
-4
No files found.
docs/conf.orig.py
View file @
f3cbc501
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
# import sys
# import sys
# import os
# import os
from
setuptools_scm
import
get_version
# If extensions (or modules to document with autodoc) are in another directory,
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# add these directories to sys.path here. If the directory is relative to the
...
@@ -54,7 +55,6 @@ copyright = '2016, Brian May'
...
@@ -54,7 +55,6 @@ copyright = '2016, Brian May'
# built documents.
# built documents.
#
#
# The short X.Y version.
# The short X.Y version.
from
setuptools_scm
import
get_version
version
=
get_version
(
root
=
".."
)
version
=
get_version
(
root
=
".."
)
# The full version, including alpha/beta/rc tags.
# The full version, including alpha/beta/rc tags.
release
=
version
release
=
version
...
...
sshuttle/cmdline.py
View file @
f3cbc501
...
@@ -29,7 +29,8 @@ def main():
...
@@ -29,7 +29,8 @@ def main():
includes
=
opt
.
subnets
includes
=
opt
.
subnets
excludes
=
opt
.
exclude
excludes
=
opt
.
exclude
if
not
includes
and
not
opt
.
auto_nets
:
if
not
includes
and
not
opt
.
auto_nets
:
parser
.
error
(
'at least one subnet, subnet file, or -N expected'
)
parser
.
error
(
'at least one subnet, subnet file, '
'or -N expected'
)
remotename
=
opt
.
remote
remotename
=
opt
.
remote
if
remotename
==
''
or
remotename
==
'-'
:
if
remotename
==
''
or
remotename
==
'-'
:
remotename
=
None
remotename
=
None
...
...
sshuttle/helpers.py
View file @
f3cbc501
...
@@ -16,6 +16,7 @@ else:
...
@@ -16,6 +16,7 @@ else:
def
b
(
s
):
def
b
(
s
):
return
s
return
s
def
log
(
s
):
def
log
(
s
):
global
logprefix
global
logprefix
try
:
try
:
...
...
sshuttle/hostwatch.py
View file @
f3cbc501
...
@@ -39,7 +39,7 @@ def write_host_cache():
...
@@ -39,7 +39,7 @@ def write_host_cache():
for
name
,
ip
in
sorted
(
hostnames
.
items
()):
for
name
,
ip
in
sorted
(
hostnames
.
items
()):
f
.
write
((
'
%
s,
%
s
\n
'
%
(
name
,
ip
))
.
encode
(
"ASCII"
))
f
.
write
((
'
%
s,
%
s
\n
'
%
(
name
,
ip
))
.
encode
(
"ASCII"
))
f
.
close
()
f
.
close
()
os
.
chmod
(
tmpname
,
384
)
# 600 in octal, 'rw-------'
os
.
chmod
(
tmpname
,
384
)
# 600 in octal, 'rw-------'
os
.
rename
(
tmpname
,
CACHEFILE
)
os
.
rename
(
tmpname
,
CACHEFILE
)
finally
:
finally
:
try
:
try
:
...
@@ -70,8 +70,8 @@ def read_host_cache():
...
@@ -70,8 +70,8 @@ def read_host_cache():
def
found_host
(
hostname
,
ip
):
def
found_host
(
hostname
,
ip
):
hostname
=
re
.
sub
(
r'\..*'
,
''
,
hostname
)
hostname
=
re
.
sub
(
r'\..*'
,
''
,
hostname
)
hostname
=
re
.
sub
(
r'[^-\w]'
,
'_'
,
hostname
)
hostname
=
re
.
sub
(
r'[^-\w]'
,
'_'
,
hostname
)
if
(
ip
.
startswith
(
'127.'
)
or
ip
.
startswith
(
'255.'
)
if
(
ip
.
startswith
(
'127.'
)
or
ip
.
startswith
(
'255.'
)
or
or
hostname
==
'localhost'
):
hostname
==
'localhost'
):
return
return
oldip
=
hostnames
.
get
(
hostname
)
oldip
=
hostnames
.
get
(
hostname
)
if
oldip
!=
ip
:
if
oldip
!=
ip
:
...
...
sshuttle/ssh.py
View file @
f3cbc501
...
@@ -15,6 +15,7 @@ except ImportError:
...
@@ -15,6 +15,7 @@ except ImportError:
# Python 2.x
# Python 2.x
from
pipes
import
quote
from
pipes
import
quote
def
readfile
(
name
):
def
readfile
(
name
):
tokens
=
name
.
split
(
"."
)
tokens
=
name
.
split
(
"."
)
f
=
None
f
=
None
...
...
sshuttle/ssnet.py
View file @
f3cbc501
...
@@ -358,8 +358,8 @@ class Mux(Handler):
...
@@ -358,8 +358,8 @@ class Mux(Handler):
def
amount_queued
(
self
):
def
amount_queued
(
self
):
total
=
0
total
=
0
for
b
in
self
.
outbuf
:
for
b
yte
in
self
.
outbuf
:
total
+=
len
(
b
)
total
+=
len
(
b
yte
)
return
total
return
total
def
check_fullness
(
self
):
def
check_fullness
(
self
):
...
@@ -376,7 +376,8 @@ class Mux(Handler):
...
@@ -376,7 +376,8 @@ class Mux(Handler):
def
send
(
self
,
channel
,
cmd
,
data
):
def
send
(
self
,
channel
,
cmd
,
data
):
assert
isinstance
(
data
,
binary_type
)
assert
isinstance
(
data
,
binary_type
)
assert
len
(
data
)
<=
65535
assert
len
(
data
)
<=
65535
p
=
struct
.
pack
(
'!ccHHH'
,
b
(
'S'
),
b
(
'S'
),
channel
,
cmd
,
len
(
data
))
+
data
p
=
struct
.
pack
(
'!ccHHH'
,
b
(
'S'
),
b
(
'S'
),
channel
,
cmd
,
len
(
data
))
\
+
data
self
.
outbuf
.
append
(
p
)
self
.
outbuf
.
append
(
p
)
debug2
(
' > channel=
%
d cmd=
%
s len=
%
d (fullness=
%
d)
\n
'
debug2
(
' > channel=
%
d cmd=
%
s len=
%
d (fullness=
%
d)
\n
'
%
(
channel
,
cmd_to_name
.
get
(
cmd
,
hex
(
cmd
)),
%
(
channel
,
cmd_to_name
.
get
(
cmd
,
hex
(
cmd
)),
...
@@ -557,7 +558,7 @@ def connect_dst(family, ip, port):
...
@@ -557,7 +558,7 @@ def connect_dst(family, ip, port):
outsock
.
setsockopt
(
socket
.
SOL_IP
,
socket
.
IP_TTL
,
42
)
outsock
.
setsockopt
(
socket
.
SOL_IP
,
socket
.
IP_TTL
,
42
)
return
SockWrapper
(
outsock
,
outsock
,
return
SockWrapper
(
outsock
,
outsock
,
connect_to
=
(
ip
,
port
),
connect_to
=
(
ip
,
port
),
peername
=
'
%
s:
%
d'
%
(
ip
,
port
))
peername
=
'
%
s:
%
d'
%
(
ip
,
port
))
def
runonce
(
handlers
,
mux
):
def
runonce
(
handlers
,
mux
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment