mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-07-24 06:25:35 +02:00
IPC env var and handle used by sshd is made unavailable to shell/subsystem
sshd.exe uses SSHD_REMSOC env var as private IPC for remote socket handle passing. The env var is deleted and the handle is made not inheritable by sshd so that shell and subsystem do not see it or have access to the handle.
This commit is contained in:
parent
3ab9c8f055
commit
e918f7c731
4
sshd.c
4
sshd.c
@ -2809,6 +2809,10 @@ main(int ac, char **av)
|
||||
remotesochandle = atoi( getenv("SSHD_REMSOC") );
|
||||
|
||||
sock_in = sock_out = newsock = allocate_sfd(remotesochandle) ; //si.hStdInput);
|
||||
|
||||
// we have the socket handle, delete it for child processes we create like shell
|
||||
SetEnvironmentVariable("SSHD_REMSOC", NULL);
|
||||
SetHandleInformation(remotesochandle, HANDLE_FLAG_INHERIT, 0); // make the handle not to be inherited
|
||||
|
||||
/*
|
||||
* We don't have a startup_pipe
|
||||
|
Loading…
x
Reference in New Issue
Block a user