]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - client_common.c
f
[paraslash.git] / client_common.c
index e67a938b4df8aa69c2536505ce86c5017ab469b2..81673a7dc5c422814b0e65cfcda52037acceb580 100644 (file)
@@ -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);