Skip to content

Commit

Permalink
ssh_connect.py: Fixed a bug with telnet connections where the port wa…
Browse files Browse the repository at this point in the history
…sn't being properly converted to a string. This should fix the issue reported in liftoff#87

Playback Plugin:  Fixed a bug where you could get UnicodeDecodeErrors when exporting the current session recording.  This should fix the issue reported in liftoff#90
  • Loading branch information
liftoff committed Mar 8, 2012
1 parent 0dfa419 commit 9f2abd1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions gateone/gateone.py
Expand Up @@ -864,6 +864,10 @@ def get_current_user(self):
return self.api_user
user_json = self.get_secure_cookie("gateone_user")
if not user_json:
if not self.settings['auth']:
# This can happen if the user's browser isn't allowing
# persistent cookies (e.g. incognito mode)
return {'upn': 'ANONYMOUS', 'session': generate_session_id()}
return None
return json_decode(user_json)

Expand Down
2 changes: 0 additions & 2 deletions gateone/plugins/playback/playback.py
Expand Up @@ -87,8 +87,6 @@ def save_recording(settings, tws):
templates_path, "self_contained_recording.html")
with open(recording_template_path) as f:
recording_template_data = f.read()
with open('/tmp/recording.json', 'w') as f:
f.write(recording)
recording_template = tornado.template.Template(recording_template_data)
rendered_recording = recording_template.generate(
recording=recording,
Expand Down
4 changes: 2 additions & 2 deletions gateone/plugins/ssh/scripts/ssh_connect.py
Expand Up @@ -429,7 +429,7 @@ def telnet_connect(user, host, port=23, env=None):
else:
env['PATH'] = os.environ['PATH']
command = which("telnet")
args = [host, port]
args = [host, str(port)]
if user:
args.insert(0, user)
args.insert(0, "-l")
Expand Down Expand Up @@ -759,7 +759,7 @@ def parse_ssh_url(url):
except KeyboardInterrupt:
print(_("\nKeyboardInterrupt detected. Quitting..."))
except Exception as e: # Catch all
print(_("Got Exception trying to run openssh_connect: %s" % e))
print(_("Got Exception: %s" % e))
import traceback
traceback.print_exc(file=sys.stdout)
print("Please open up a new issue at https://github.com/liftoff"
Expand Down

0 comments on commit 9f2abd1

Please sign in to comment.