From af2d09282eb41022d9ecb485f78ad6b1a3c62f4e Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Sat, 05 Jul 2008 00:46:42 +0000
Subject: [PATCH] Fix for issue 3461 (winlauncher should not inherit handlers from parent process)
---
opendj-sdk/opends/src/build-tools/windows/common.c | 10 ++++++++++
opendj-sdk/opends/lib/opends_service.exe | 0
opendj-sdk/opends/lib/winlauncher.exe | 0
opendj-sdk/opends/lib/launcher_administrator.exe | 0
4 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/opendj-sdk/opends/lib/launcher_administrator.exe b/opendj-sdk/opends/lib/launcher_administrator.exe
index 7b1ba12..dc40609 100644
--- a/opendj-sdk/opends/lib/launcher_administrator.exe
+++ b/opendj-sdk/opends/lib/launcher_administrator.exe
Binary files differ
diff --git a/opendj-sdk/opends/lib/opends_service.exe b/opendj-sdk/opends/lib/opends_service.exe
index 546161b..dac8d18 100755
--- a/opendj-sdk/opends/lib/opends_service.exe
+++ b/opendj-sdk/opends/lib/opends_service.exe
Binary files differ
diff --git a/opendj-sdk/opends/lib/winlauncher.exe b/opendj-sdk/opends/lib/winlauncher.exe
index 5c836f0..ba44236 100755
--- a/opendj-sdk/opends/lib/winlauncher.exe
+++ b/opendj-sdk/opends/lib/winlauncher.exe
Binary files differ
diff --git a/opendj-sdk/opends/src/build-tools/windows/common.c b/opendj-sdk/opends/src/build-tools/windows/common.c
index 2917d88..3974748 100644
--- a/opendj-sdk/opends/src/build-tools/windows/common.c
+++ b/opendj-sdk/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;
--
Gitblit v1.10.0