mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
Allow remote session processes to break away from session job object
PowerShell/Win32-OpenSSH#1032 Issue: Ssh-shellhost.exe creates a job object and ties all its child processes to its lifetime. It does not allow the child processes to break away from this job. This restriction is unnecessary. Fix: Modified job object to allow child processes to break away if they need to.
This commit is contained in:
parent
b92b7c9480
commit
fd580e9d96
@ -1790,7 +1790,7 @@ wmain(int ac, wchar_t **av)
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset(&job_info, 0, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION));
|
memset(&job_info, 0, sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION));
|
||||||
job_info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
|
job_info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE | JOB_OBJECT_LIMIT_BREAKAWAY_OK;
|
||||||
|
|
||||||
if (!SetInformationJobObject(job, JobObjectExtendedLimitInformation, &job_info, sizeof(job_info)) ||
|
if (!SetInformationJobObject(job, JobObjectExtendedLimitInformation, &job_info, sizeof(job_info)) ||
|
||||||
!AssignProcessToJobObject(job, GetCurrentProcess())) {
|
!AssignProcessToJobObject(job, GetCurrentProcess())) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user