Fixes in sshd

This commit is contained in:
manojampalam 2016-04-03 18:06:48 -07:00
parent 090c14b6e3
commit 0861b4ea3a
2 changed files with 2 additions and 5 deletions

View File

@ -184,7 +184,7 @@ sw_process_pending_signals() {
BOOL sig_int = FALSE; /* has any signal actually interrupted */ BOOL sig_int = FALSE; /* has any signal actually interrupted */
debug3("process_signals()"); debug3("process_signals()");
int i, exp[] = { W32_SIGCHLD , W32_SIGINT , W32_SIGALRM }; int i, exp[] = { W32_SIGCHLD , W32_SIGINT , W32_SIGALRM, W32_SIGTERM, W32_SIGTSTP };
/* check for expected signals*/ /* check for expected signals*/
for (i = 0; i < (sizeof(exp) / sizeof(exp[0])); i++) for (i = 0; i < (sizeof(exp) / sizeof(exp[0])); i++)

5
sshd.c
View File

@ -380,7 +380,6 @@ static void do_ssh2_kex(void);
SetServiceStatus( gSvcStatusHandle, &gSvcStatus ); SetServiceStatus( gSvcStatusHandle, &gSvcStatus );
} }
static VOID WINAPI SSHDHandlerEx(DWORD dwControl) static VOID WINAPI SSHDHandlerEx(DWORD dwControl)
{ {
debug("Request received (%u)", dwControl); debug("Request received (%u)", dwControl);
@ -397,8 +396,7 @@ static void do_ssh2_kex(void);
ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 500); ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 500);
raise(SIGINT); GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, 0);
/*TODO - wait for main thread to unwind */
ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0); ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0);
return; return;
@ -1614,7 +1612,6 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
sw_add_child(pi.hProcess, pi.dwProcessId); sw_add_child(pi.hProcess, pi.dwProcessId);
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
pid = pi.dwProcessId; pid = pi.dwProcessId;
} }