X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=client_common.c;h=865a1797bd81bbd7e6308278c08249890c1bf241;hb=0a7adba52fad8301b9c5daf263a56f630c35623f;hp=33ad19546d2a6e8f5d072152f75e11fefbd6fb18;hpb=d7b4aa3835197ee906f13f515040e1cda6385544;p=paraslash.git diff --git a/client_common.c b/client_common.c index 33ad1954..865a1797 100644 --- a/client_common.c +++ b/client_common.c @@ -21,6 +21,7 @@ #include "client.cmdline.h" #include "client.h" #include "buffer_tree.h" +#include "version.h" /** The size of the receiving buffer. */ #define CLIENT_BUFSIZE 4000 @@ -393,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);