2011-11-22 Ramon Novoa <rnovoa@artica.es>

* pandora_windows_service.cc: Fixed a bug that resulted in a buffer
	  overflow.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5150 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2011-11-22 12:44:47 +00:00
parent d1fd9d677e
commit f260ae4bd7
2 changed files with 19 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2011-11-22 Ramon Novoa <rnovoa@artica.es>
* pandora_windows_service.cc: Fixed a bug that resulted in a buffer
overflow.
2011-11-15 Ramon Novoa <rnovoa@artica.es>
* build.sh, modules/pandora_module_odbc.cc, Makefile.am: Made

View File

@ -216,17 +216,10 @@ Pandora_Windows_Service::pandora_init () {
string name_agent, name;
string proxy_mode, server_ip;
int pos, num;
static unsigned char first_run = 0;
static unsigned char first_run = 1;
setPandoraDebug (true);
// Add the util subdirectory to the PATH
util_dir = Pandora::getPandoraInstallDir ();
util_dir += "util";
path = getenv ("PATH");
env = "PATH=" + path + ";" + util_dir;
putenv (env.c_str ());
conf_file = Pandora::getPandoraInstallDir ();
conf_file += "pandora_agent.conf";
@ -273,7 +266,6 @@ Pandora_Windows_Service::pandora_init () {
}
}
srand ((unsigned) time (0));
this->setSleepTime (this->interval);
/*Check if proxy mode is set*/
@ -292,8 +284,19 @@ Pandora_Windows_Service::pandora_init () {
((UDP_Server *)this->udp_server)->start ();
}
if (first_run == 0) {
first_run = 1;
if (first_run == 1) {
first_run = 0;
// Add the util subdirectory to the PATH
util_dir = Pandora::getPandoraInstallDir ();
util_dir += "util";
path = getenv ("PATH");
env = "PATH=" + path + ";" + util_dir;
putenv (env.c_str ());
// Set the seed for rand
srand ((unsigned) time (0));
pandoraLog ("Pandora agent started");
}
}