1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

Workaround ssh_get_user_home_dir on LDAP users

This commit is contained in:
Aris Adamantiadis
2011-07-13 12:04:04 +02:00
parent cc29fef234
commit 54fb43358c

View File

@@ -215,7 +215,8 @@ char *ssh_get_user_home_dir(void) {
rc = getpwuid_r(getuid(), &pwd, buf, NSS_BUFLEN_PASSWD, &pwdbuf); rc = getpwuid_r(getuid(), &pwd, buf, NSS_BUFLEN_PASSWD, &pwdbuf);
if (rc != 0) { if (rc != 0) {
return NULL; szPath=getenv("HOME");
return szPath ? strdup(szPath) : NULL;
} }
szPath = strdup(pwd.pw_dir); szPath = strdup(pwd.pw_dir);