mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
05.46.2008 d64e64ecd60cadb2dbda547f35cd5a88c8fcad21
Fix for issue 3461 (winlauncher should not inherit handlers from parent process)

The fix consists in setting the inheritance flag of tderr/stdout/stdin of the parent process to FALSE before creating the child process.
4 files modified
10 ■■■■■ changed files
opends/lib/launcher_administrator.exe patch | view | raw | blame | history
opends/lib/opends_service.exe patch | view | raw | blame | history
opends/lib/winlauncher.exe patch | view | raw | blame | history
opends/src/build-tools/windows/common.c 10 ●●●●● patch | view | raw | blame | history
opends/lib/launcher_administrator.exe
Binary files differ
opends/lib/opends_service.exe
Binary files differ
opends/lib/winlauncher.exe
Binary files differ
opends/src/build-tools/windows/common.c
@@ -52,6 +52,9 @@
  BOOL createOk;
  STARTUPINFO startInfo; // info to pass to the new process
  DWORD processFlag; // background process flag
  HANDLE hStdin;                  /* stdin */
  HANDLE hStdout;                 /* stdout */
  HANDLE hStderr;                 /* stderr */
  debug("Attempting to create child process '%s' background=%d.", command,
      background);
@@ -63,6 +66,13 @@
  ZeroMemory(&startInfo, sizeof(STARTUPINFO));
  startInfo.cb = sizeof(STARTUPINFO);
  startInfo.dwFlags |= STARTF_USESTDHANDLES;  // use handles above
  hStdin= GetStdHandle(STD_INPUT_HANDLE);
  SetHandleInformation (hStdin,  HANDLE_FLAG_INHERIT, FALSE);
  hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
  SetHandleInformation (hStdout, HANDLE_FLAG_INHERIT, FALSE);
  hStderr = GetStdHandle(STD_ERROR_HANDLE);
  SetHandleInformation (hStderr, HANDLE_FLAG_INHERIT, FALSE);
  // Create the child process
  processFlag = background == TRUE ? DETACHED_PROCESS : 0;