PDA

View Full Version : PATCH: Correction for Win32 Agent dying uncontrollably. (1.1Beta12)


bcheese
02-06-2006, 07:20
There has been discusison on the forum for errors dealing with the retrieving of event logs on Win32 servers. Below is a patch which fixes the error where a NULL is being passed into your ASM strcpy command. This will provide a short term ability to get users working. I have attached a copy of a new binary which has this patch applied.


--- eventlog.cpp Fri Jun 02 14:04:45 2006
+++ eventlog.cpp.patch Fri Jun 02 12:23:13 2006
@@ -246,12 +246,18 @@
MAX_MSG_LENGTH, /* maximum size of the message buffer */
aInsertStrs); /* array of insert strings for the message */

- strcpy(pMessage,msgBuf); // copy message
- err = 0;
+ LOG_DEBUG_INFO("s",msgBuf);

- /* Free the buffer that FormatMessage allocated for us. */
- if(msgBuf) LocalFree((HLOCAL) msgBuf);
+ if (msgBuf)
+ {
+ strcpy(pMessage,msgBuf); // copy message
+ err = 0;
+
+ /* Free the buffer that FormatMessage allocated for us. */
+ LocalFree((HLOCAL) msgBuf);
+ }
FreeLibrary(hLib);
+
}
}

Alexei
02-06-2006, 10:09
Many thanks for the patch! Applied.

RohrbaGe
02-06-2006, 18:50
Hi,

on my test system 1.1b12 on Suse 9.2 and a Windows 2003 server
I installed this agent.

I can confirm, that the agent is not dieing any more direct after start,
even if I have the hostname=xxx in the config file.

But the event log is not coming to the zabbix server.

Restarting of the zabbix_server and/or the agent does not helped


Regards
Gerald