summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-07-13 12:04:04 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2011-07-13 12:04:04 +0200
commitf201e983b0a58bd7b216fafd656fcb1a482e3ea9 (patch)
tree214bbf6afa5db82766cda8d438a5b53136822c49 /src
parent81332e1e2739b997923dbe4deb07efaf60dd5fe4 (diff)
downloadlibssh-f201e983b0a58bd7b216fafd656fcb1a482e3ea9.tar.gz
libssh-f201e983b0a58bd7b216fafd656fcb1a482e3ea9.tar.xz
libssh-f201e983b0a58bd7b216fafd656fcb1a482e3ea9.zip
Workaround ssh_get_user_home_dir on LDAP users
Diffstat (limited to 'src')
-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);