Steve Kowalik has proposed merging 
lp:~stevenk/launchpad/fix-ssh-keys-make-lp-user into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


This branch fixes the addition of DSA SSH keys in utilities/make-lp-user. The 
current way is wrong, since the code itself was splitting the key up, and it 
was using the wrong key-type for DSA keys, it's actually ssh-dss.

Why haven't we seen this before, since utilities/make-lp-user is running 
(indirectly) via the test suite? I suspect the reason for this is because the 
ec2 and buildbot machines don't actually get to the line that adds the keys, 
since they don't have any keys, most developers don't run the entire test suite 
on their machines, and the test that triggers this bug is a soyuz sampledata 
test.
-- 
https://code.launchpad.net/~stevenk/launchpad/fix-ssh-keys-make-lp-user/+merge/32543
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~stevenk/launchpad/fix-ssh-keys-make-lp-user into lp:launchpad/devel.
=== modified file 'utilities/make-lp-user'
--- utilities/make-lp-user	2010-07-22 17:32:26 +0000
+++ utilities/make-lp-user	2010-08-13 01:33:47 +0000
@@ -109,24 +109,17 @@
     """
     ssh_dir = os.path.expanduser('~/.ssh')
     key_set = getUtility(ISSHKeySet)
-    key_guesses = [
-        ("ssh-rsa", 'id_rsa.pub'),
-        ("ssh-dsa", 'id_dsa.pub'),
-        ]
-    for key_type, guessed_filename in key_guesses:
-        guessed_filename = os.path.join(ssh_dir, guessed_filename)
+    for filename in ('id_rsa.pub', 'id_dsa.pub'):
         try:
-            public_key_file = open(guessed_filename, 'r')
+            public_key_file = open(filename, 'r')
             try:
                 public_key = public_key_file.read()
             finally:
                 public_key_file.close()
         except (OSError, IOError):
             continue
-        public_key = public_key.split()[1]
-        key_set.new(person,
-            "%s %s %s" % (key_type, public_key, 'Added by utility script.'))
-        print 'Registered SSH key: %s' % (guessed_filename,)
+        key_set.new(person, public_key)
+        print 'Registered SSH key: %s' % (filename,)
 
 
 def parse_fingerprints(gpg_output):

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to