Bug 284071 - [Patch] Add option to set ssh identity file
Summary: [Patch] Add option to set ssh identity file
Status: RESOLVED FIXED
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: general (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-15 10:40 UTC by Ralf Jung
Modified: 2011-10-20 13:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 1.14.2


Attachments
A patch that fixes the problem for me (1.33 KB, patch)
2011-10-15 10:40 UTC, Ralf Jung
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Jung 2011-10-15 10:40:40 UTC
Created attachment 64536 [details]
A patch that fixes the problem for me

Version:           git (using Devel) 
OS:                Linux

I am not using the default filename ~/.ssh/id_rsa{,.pub} for my SSH key, since I have several keys and always want to decide myself which one to use - I don't want an app to pick up an incorrect default key.
However, kdesrc-build assumes that the default keyname is used when invoking ssh-add. After calling "ssh-add ~/.ssh/keyfile" manually, svn seems to pick up the correct key itself.
It should be possible to override the default via some option in the kdesrc-buildrc file.

Reproducible: Always

Steps to Reproduce:
Make sure you do not have an SSH key under a default name in ~/.ssh, and invoke kdesrc-build.

Actual Results:  
kdesrc-build runs ssh-add, which fails.

Expected Results:  
kdesrc-build should provide an option to pass a parameter to ssh-add, specifying the key file to be added.

You can find a patch that fixes the problem for me attached - however, I don't know Perl that well, so it might fail horribly for corner cases, or even for the default of not using the given option.
Comment 1 Michael Pyne 2011-10-19 23:45:14 UTC
Regarding the proposed patch, the option naming should probably be ssh-specific (especially in case kdesrc-build ever ends up integrating with identity.kde.org as well). ssh-identity-file is probably a fine name for it.

When the option is not set, it shouldn't default to passing in a given filename, but should just run ssh-add with no options as is currently done as the user may have set a different file as the default.

Also, documentation for the new option would be nice. ;)

With that said I like the idea so I'll try to integrate tonight.
Comment 2 Michael Pyne 2011-10-20 00:13:06 UTC
Git commit 2430b0a308bc63c5d008ba602f0bcf345d35166f by Michael Pyne.
Committed on 20/10/2011 at 02:11.
Pushed by mpyne into branch 'master'.

Allow SSH identity to be specified.

Now you can specify the private key to be passed to your SSH agent if
you forgot to run that before running kdesrc-build.

Proof-of-concept patch graciously provided by Ralf Jung.

BUG:284071
FIXED-IN:1.14.2

M  +13   -0    doc/index.docbook
M  +8    -1    kdesrc-build

http://commits.kde.org/kdesrc-build/2430b0a308bc63c5d008ba602f0bcf345d35166f
Comment 3 Ralf Jung 2011-10-20 13:27:31 UTC
Great, thanks a lot :)

(I was about to write that I do not know enough Perl to check for an option being unset... :D )