From 231e601545d0a09d84d3c5c2786d774f56fe9217 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sun, 3 Feb 2008 00:13:03 -0800 Subject: Avoid trailing whitespace messing up the keyname. --- gitosis/init.py | 1 + gitosis/sshkey.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gitosis/init.py b/gitosis/init.py index 105ac4c..ceeaba6 100644 --- a/gitosis/init.py +++ b/gitosis/init.py @@ -140,6 +140,7 @@ class Main(app.App): user = _.username else: user = options.adminname + user = user.strip() if user is None: log.error('Cannot parse user from SSH public key.') sys.exit(1) diff --git a/gitosis/sshkey.py b/gitosis/sshkey.py index 145d746..802145b 100644 --- a/gitosis/sshkey.py +++ b/gitosis/sshkey.py @@ -141,7 +141,7 @@ def _explode_ssh_key(line): Seperately return the options, key data and comment. """ opts = {} - shl = shlex(StringIO(line), None, True) + shl = shlex(StringIO(line.strip()), None, True) shl.wordchars += '-' # Treat ',' as whitespace seperation the options shl.whitespace += ',' -- cgit v1.2.3