Commit 135577db authored by Luke Macken's avatar Luke Macken

No need to tweak sys.path in the reverse connection payload anymore.

pyrasite.inject will now do this for us, to ensure that our payloads can always
'import pyrasite'
parent 39d1d2b0
...@@ -99,9 +99,8 @@ class PyrasiteIPC(object): ...@@ -99,9 +99,8 @@ class PyrasiteIPC(object):
"""Write out a reverse python connection payload with a custom port""" """Write out a reverse python connection payload with a custom port"""
(fd, filename) = tempfile.mkstemp() (fd, filename) = tempfile.mkstemp()
tmp = os.fdopen(fd, 'w') tmp = os.fdopen(fd, 'w')
path = dirname(abspath(join(pyrasite.__file__, '..'))) path = dirname(abspath(pyrasite.__file__))
payload = open(join(path, 'pyrasite', 'reverse.py')) payload = open(join(path, 'reverse.py'))
tmp.write('import sys; sys.path.insert(0, "%s")\n' % path)
for line in payload.readlines(): for line in payload.readlines():
if line.startswith('#'): if line.startswith('#'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment