From 0a7adba52fad8301b9c5daf263a56f630c35623f Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 25 Nov 2010 08:56:34 +0100 Subject: [PATCH] client: Also try to load the private rsa-ssh key. If no key file was given and the default key file ~/.paraslash/key. does not exist, try ~/.ssh/id_rsa. --- client_common.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client_common.c b/client_common.c index d3a9ede1..865a1797 100644 --- a/client_common.c +++ b/client_common.c @@ -394,9 +394,16 @@ int client_open(int argc, char *argv[], struct client_task **ct_ptr, ct->user = ct->conf.user_given? para_strdup(ct->conf.user_arg) : para_logname(); - ct->key_file = ct->conf.key_file_given? - para_strdup(ct->conf.key_file_arg) : - make_message("%s/.paraslash/key.%s", home, ct->user); + if (ct->conf.key_file_given) + ct->key_file = para_strdup(ct->conf.key_file_arg); + else { + ct->key_file = make_message("%s/.paraslash/key.%s", + home, ct->user); + if (!file_exists(ct->key_file)) { + free(ct->key_file); + ct->key_file = make_message("%s/.ssh/id_rsa", home); + } + } if (loglevel) *loglevel = get_loglevel_by_name(ct->conf.loglevel_arg); -- 2.30.2