aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/misc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/misc.c b/src/misc.c
index 43ac7013..0e08fa2b 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -215,7 +215,8 @@ char *ssh_get_user_home_dir(void) {
rc = getpwuid_r(getuid(), &pwd, buf, NSS_BUFLEN_PASSWD, &pwdbuf);
if (rc != 0) {
- return NULL;
+ szPath=getenv("HOME");
+ return szPath ? strdup(szPath) : NULL;
}
szPath = strdup(pwd.pw_dir);