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:
parent
7e69b4e13c
commit
d0e93703a4
|
@ -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>
|
||||
|
||||
* pandora_agent: Fixed bug #2888991. Skip remote_config if debug is enabled.
|
||||
|
|
|
@ -140,7 +140,7 @@ sub log_message ($$;$) {
|
|||
sub read_config (;$) {
|
||||
my $token = shift;
|
||||
my $module;
|
||||
|
||||
|
||||
error ("File '$ConfDir/$ConfFile' not found.") unless (-e "$ConfDir/$ConfFile");
|
||||
open (CONF_FILE, "$ConfDir/$ConfFile") or error ("Could not open file '$ConfDir/$ConfFile': $!.");
|
||||
while (my $line = <CONF_FILE>) {
|
||||
|
@ -347,6 +347,10 @@ sub check_remote_config () {
|
|||
return if (recv_file ($RemoteConfFile) != 0);
|
||||
log_message ('remote config', 'Configuration has changed!');
|
||||
|
||||
# Empty modules and plugins
|
||||
@Modules = ();
|
||||
@Plugins = ();
|
||||
|
||||
# Save the new configuration and reload it
|
||||
move ("$Conf{'temporal'}/$RemoteConfFile", "$ConfDir/$ConfFile");
|
||||
read_config ();
|
||||
|
@ -362,7 +366,7 @@ sub check_remote_config () {
|
|||
sub leftrotate ($$) {
|
||||
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;
|
||||
}
|
||||
else {
|
||||
$f = $c ^ ($b | (~ $d));
|
||||
$f = $c ^ ($b | (0xFFFFFFFF & (~ $d)));
|
||||
$g = (7 * $y) % 16;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue