2009-12-03 Ramon Novoa <rnovoa@artica.es>

* pandora_agent: Empty modules and plugins before loading a remote
          configuration. Made the md5 function 64bit proof :-)




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2155 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2009-12-03 18:35:08 +00:00
parent 7e69b4e13c
commit d0e93703a4
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2009-12-03 Ramon Novoa <rnovoa@artica.es>
* pandora_agent: Empty modules and plugins before loading a remote
configuration. Made the md5 function 64bit proof :-)
2009-11-19 Ramon Novoa <rnovoa@artica.es> 2009-11-19 Ramon Novoa <rnovoa@artica.es>
* pandora_agent: Fixed bug #2888991. Skip remote_config if debug is enabled. * pandora_agent: Fixed bug #2888991. Skip remote_config if debug is enabled.

View File

@ -140,7 +140,7 @@ sub log_message ($$;$) {
sub read_config (;$) { sub read_config (;$) {
my $token = shift; my $token = shift;
my $module; my $module;
error ("File '$ConfDir/$ConfFile' not found.") unless (-e "$ConfDir/$ConfFile"); error ("File '$ConfDir/$ConfFile' not found.") unless (-e "$ConfDir/$ConfFile");
open (CONF_FILE, "$ConfDir/$ConfFile") or error ("Could not open file '$ConfDir/$ConfFile': $!."); open (CONF_FILE, "$ConfDir/$ConfFile") or error ("Could not open file '$ConfDir/$ConfFile': $!.");
while (my $line = <CONF_FILE>) { while (my $line = <CONF_FILE>) {
@ -347,6 +347,10 @@ sub check_remote_config () {
return if (recv_file ($RemoteConfFile) != 0); return if (recv_file ($RemoteConfFile) != 0);
log_message ('remote config', 'Configuration has changed!'); log_message ('remote config', 'Configuration has changed!');
# Empty modules and plugins
@Modules = ();
@Plugins = ();
# Save the new configuration and reload it # Save the new configuration and reload it
move ("$Conf{'temporal'}/$RemoteConfFile", "$ConfDir/$ConfFile"); move ("$Conf{'temporal'}/$RemoteConfFile", "$ConfDir/$ConfFile");
read_config (); read_config ();
@ -362,7 +366,7 @@ sub check_remote_config () {
sub leftrotate ($$) { sub leftrotate ($$) {
my ($x, $c) = @_; my ($x, $c) = @_;
return ($x << $c) | ($x >> (32 - $c)); return (0xFFFFFFFF & ($x << $c)) | ($x >> (32 - $c));
} }
############################################################################### ###############################################################################
@ -446,7 +450,7 @@ sub md5 ($) {
$g = (3 * $y + 5) % 16; $g = (3 * $y + 5) % 16;
} }
else { else {
$f = $c ^ ($b | (~ $d)); $f = $c ^ ($b | (0xFFFFFFFF & (~ $d)));
$g = (7 * $y) % 16; $g = (7 * $y) % 16;
} }