X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=client_common.c;h=81673a7dc5c422814b0e65cfcda52037acceb580;hb=0e4041d35489add520ff095c8ed8753584814b8e;hp=e67a938b4df8aa69c2536505ce86c5017ab469b2;hpb=53293c816d0f0e0c2be8bd28920dc185829b0c2e;p=paraslash.git diff --git a/client_common.c b/client_common.c index e67a938b..81673a7d 100644 --- a/client_common.c +++ b/client_common.c @@ -585,8 +585,14 @@ int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr, const char *confdir = get_confdir(); kf = make_message("%s/key.%s", confdir, user); if (stat(kf, &statbuf) != 0) { /* assume file does not exist */ + const char *home = getenv("HOME"); free(kf); - kf = make_message("%s/.ssh/id_rsa", confdir); + if (!home || !*home) { + ret = -ERRNO_TO_PARA_ERROR(EINVAL); + errctx = make_message("HOME unset or empty"); + goto out; + } + kf = make_message("%s/.ssh/id_rsa", home); } } PARA_INFO_LOG("user: %s\n", user);