aboutsummaryrefslogtreecommitdiff
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:46 +0200
commit54fb43358cc7c7e50aa2d4d4b8c3697a3831e69b (patch)
tree3df1b8668256cc2f876841737ff922fc87f2d6f6 /src
parentcc29fef2344fcbc33bf691aafa274752df43c30c (diff)
downloadlibssh-54fb43358cc7c7e50aa2d4d4b8c3697a3831e69b.tar.gz
libssh-54fb43358cc7c7e50aa2d4d4b8c3697a3831e69b.tar.xz
libssh-54fb43358cc7c7e50aa2d4d4b8c3697a3831e69b.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);