mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-23 05:55:41 +02:00
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:
parent
ded4138b58
commit
44a6f54fc4
@ -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.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user