mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
Workaround ssh_get_user_home_dir on LDAP accounts
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user