sshd updates USERDOMAIN env variable correctly

USERDOMAIN environment variable was not being updated by sshd before s
shell or subsystem was started, hence it was left pointing to local
logged on user;'s domain. Now we set it correctly for the remote ssh
user's domain or local account
This commit is contained in:
quamrulmina 2015-10-12 23:58:57 -05:00
parent ded4138b58
commit 44a6f54fc4

View File

@ -740,6 +740,11 @@ do_exec_no_pty(Session *s, const char *command)
SetEnvironmentVariableW(L"HOME", s -> pw -> pw_dir);
SetEnvironmentVariableW(L"USERPROFILE", s -> pw -> pw_dir);
// find the server name of the domain controller which created this token
GetDomainFromToken ( &hToken, buf, sizeof(buf));
if (buf[0])
SetEnvironmentVariable("USERDOMAIN", buf );
/*
* Set SSH_CLIENT variable.
*/