summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-07-13 11:59:40 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2011-07-13 11:59:40 +0200
commit75dc5939ed57fb353b5f7a1bb7e1455c75d53616 (patch)
treea1b2fdb75c2daa95675e733a5e95c1115b128869
parent4d85f7b1e5152906c50fc8b6ebcc952946675a3d (diff)
downloadlibssh-v0-4.tar.gz
libssh-v0-4.tar.xz
libssh-v0-4.zip
Workaround ssh_get_user_home_dir on LDAP accountsv0-4
-rw-r--r--libssh/misc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libssh/misc.c b/libssh/misc.c
index 7e842770..14b155c3 100644
--- a/libssh/misc.c
+++ b/libssh/misc.c
@@ -129,9 +129,11 @@ 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);
return szPath;