Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4551)

Issue 40870047: Improve ssh auth key utils (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by wallyworld
Modified:
10 years, 4 months ago
Reviewers:
jameinel, mp+198747, rog
Visibility:
Public.

Description

Improve ssh auth key utils This branch addesses some of the issues raised by jam in https://codereview.appspot.com/37560043/. I landed the branch before seeing the comments. It's not quite perfect yet. Lines in the auth keys file which have "command" or "from" et al directives are preserved, but the key on those lines is not recognised for dup checking when adding etc. Also, when keys are changed and written out, all of the "non key" lines are written at the top of the file, followed by the juju keys. The above issues are not critical for juju. Nodes managed by juju will have auth key files fully managed by juju so the issues are irrelevant unless the user edits the auth keys file by hand. For manually provisioned nodes, the auth key file is more likely to be hand edited. But in all cases, lines Juju doesn't recognise are never deleted. The worst that will happen is a duplicate key might be added if there were a manually added line with a command prefixing the key and the same key is added to Juju. A future branch will address the above remaining issue. https://code.launchpad.net/~wallyworld/juju-core/ssh-auth-keys-fixes/+merge/198747 Requires: https://code.launchpad.net/~wallyworld/juju-core/keymanager-add-delete/+merge/198673 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : Improve ssh auth key utils #

Total comments: 6

Patch Set 3 : Improve ssh auth key utils #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -29 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M environs/sync/sync.go View 3 chunks +2 lines, -16 lines 0 comments Download
M utils/file.go View 2 chunks +16 lines, -0 lines 0 comments Download
M utils/file_test.go View 2 chunks +19 lines, -0 lines 0 comments Download
M utils/ssh/authorisedkeys.go View 1 2 4 chunks +35 lines, -3 lines 0 comments Download
M utils/ssh/authorisedkeys_test.go View 3 chunks +11 lines, -7 lines 0 comments Download
M utils/ssh/export_test.go View 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 7
wallyworld
Please take a look.
10 years, 4 months ago (2013-12-12 13:56:59 UTC) #1
jameinel
I think we want to use Rename rather than CopyFile, but otherwise LGTM https://codereview.appspot.com/40870047/diff/1/utils/ssh/authorisedkeys.go File ...
10 years, 4 months ago (2013-12-12 14:02:48 UTC) #2
wallyworld
Please take a look. https://codereview.appspot.com/40870047/diff/1/utils/ssh/authorisedkeys.go File utils/ssh/authorisedkeys.go (right): https://codereview.appspot.com/40870047/diff/1/utils/ssh/authorisedkeys.go#newcode65 utils/ssh/authorisedkeys.go:65: f, err := ioutil.TempFile(os.TempDir(), authKeysFile) ...
10 years, 4 months ago (2013-12-12 14:20:45 UTC) #3
jameinel
A couple small points, but LGTM https://codereview.appspot.com/40870047/diff/20001/utils/file.go File utils/file.go (right): https://codereview.appspot.com/40870047/diff/20001/utils/file.go#newcode53 utils/file.go:53: func CopyFile(dest, source ...
10 years, 4 months ago (2013-12-12 14:29:59 UTC) #4
rog
https://codereview.appspot.com/40870047/diff/20001/utils/ssh/authorisedkeys.go File utils/ssh/authorisedkeys.go (right): https://codereview.appspot.com/40870047/diff/20001/utils/ssh/authorisedkeys.go#newcode67 utils/ssh/authorisedkeys.go:67: err = ioutil.WriteFile(tempFile, []byte(keyData), 0755) 0755 is wrong here ...
10 years, 4 months ago (2013-12-12 18:19:01 UTC) #5
wallyworld
Please take a look. https://codereview.appspot.com/40870047/diff/20001/utils/file.go File utils/file.go (right): https://codereview.appspot.com/40870047/diff/20001/utils/file.go#newcode53 utils/file.go:53: func CopyFile(dest, source string) error ...
10 years, 4 months ago (2013-12-12 21:58:08 UTC) #6
jameinel
10 years, 4 months ago (2013-12-13 04:08:45 UTC) #7
LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b