diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index 6227f5b553..e3972c1366 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,8 @@ +2010-05-13 Ramon Novoa + + * pandora_windows_service.cc: Check the return codee of the tentacle + client. Fixes bug #2972399. + 2010-05-12 Ramon Novoa * build.sh: Added to repository. Pandora Agent installer build script. diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc index 6764e5c4de..d37db09d20 100644 --- a/pandora_agents/win32/pandora_windows_service.cc +++ b/pandora_agents/win32/pandora_windows_service.cc @@ -232,7 +232,7 @@ Pandora_Windows_Service::copyTentacleDataFile (string host, string pass, string opts) { - bool rc = false; + DWORD rc; string var, filepath; string tentacle_cmd, working_dir; PROCESS_INFORMATION pi; @@ -273,16 +273,19 @@ Pandora_Windows_Service::copyTentacleDataFile (string host, ZeroMemory (&si, sizeof (si)); ZeroMemory (&pi, sizeof (pi)); - rc = CreateProcess (NULL , (CHAR *)tentacle_cmd.c_str (), NULL, NULL, FALSE, CREATE_NO_WINDOW, - NULL, NULL, &si, &pi); - WaitForSingleObject(pi.hProcess, INFINITE); - if (rc == true) { - return 0; + if (CreateProcess (NULL , (CHAR *)tentacle_cmd.c_str (), NULL, NULL, FALSE, + CREATE_NO_WINDOW, NULL, NULL, &si, &pi) == 0) { + return -1; } - pandoraDebug ("Tentacle client was unable to copy %s", - filename.c_str ()); - return -1; + /* Get the return code of the tentacle client*/ + WaitForSingleObject(pi.hProcess, INFINITE); + GetExitCodeProcess (pi.hProcess, &rc); + if (rc != 0) { + return -1; + } + + return 0; } int