summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2176c59)
raw | patch | inline | side by side (parent: 2176c59)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Apr 2011 12:16:12 +0000 (12:16 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Apr 2011 12:16:12 +0000 (12:16 +0000) |
- When checking key/xml validity test for xml-indicator before trying
to parse the XML output. Throw exception with a specific error message
if this indicator cannot be found.
- Only check key and xml validity if incoming message is from current
server
- Remove sig_die_handler in client and server
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20655 594d385d-05f5-0310-b6e9-bd551577e9d8
to parse the XML output. Throw exception with a specific error message
if this indicator cannot be found.
- Only check key and xml validity if incoming message is from current
server
- Remove sig_die_handler in client and server
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20655 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-si/gosa-si-client | patch | blob | history | |
trunk/gosa-si/gosa-si-server | patch | blob | history |
index 5ce0d368fc429a0d9661857f1952bbafb510f8e3..972d299d536cfd437988e8ff2c5047f6ee4e608c 100755 (executable)
return 1;
}
-sub sig_die_handler
-{
- my @loc = caller(0);
- daemon_log( "SIGDIE line " . $loc[2] . ": " . $_[0], 1 );
- clean_shutdown();
- return 1;
-}
-
$SIG{'INT'} = \&sig_int_or_term_handler;
$SIG{'TERM'} = \&sig_int_or_term_handler;
$SIG{'__WARN__'} = \&sig_warn_handler;
-$SIG{'__DIE__'} = \&sig_die_handler;
$SIG{'USR1'} = 'IGNORE';
$SIG{'USR2'} = 'IGNORE';
my $msg_hash;
eval{
$msg = &decrypt_msg($crypted_msg, $module_key);
+ if ($msg !~ /^<xml>/i ) {
+ die 'could not decrypt message';
+ }
&main::daemon_log("decrypted_msg: \n$msg", 9);
$msg_hash = $xml->XMLin($msg, ForceArray=>1);
my $remote_ip = $heap->{'remote_ip'},
my $error = 0;
my $answer;
+ my $msg;
+ my $msg_hash;
daemon_log("INFO: Incoming msg from '$remote_ip'", 5);
daemon_log("DEBUG: Incoming msg:\n$input\n", 9);
- my ($msg, $msg_hash) = &check_key_and_xml_validity($input, $server_key);
+ if (not "$remote_ip" eq "$server_ip") {
+ daemon_log("INFO: Incoming msg not from server, ignoring", 5);
+ $error++;
+ } else {
+ ($msg, $msg_hash) = &check_key_and_xml_validity($input, $server_key);
if( (!$msg) || (!$msg_hash) ) {
daemon_log("WARNING: Deciphering of incoming msg failed", 3);
if($server_address =~ /$remote_ip/) {
}
$error++;
}
-
+ }
######################
# process incoming msg
index 18723f8b2213841d3601acc356437ba43866cc94..9d574ed0670cad58248da6b5e49d0d25e6450be8 100755 (executable)
return 1;
}
-sub sig_die_handler
-{
- my @loc = caller(0);
- daemon_log( "SIGDIE line " . $loc[2] . ": " . $_[0], 1 );
- clean_shutdown();
- return 1;
-}
-
$SIG{'INT'} = \&sig_int_or_term_handler;
$SIG{'TERM'} = \&sig_int_or_term_handler;
$SIG{'__WARN__'} = \&sig_warn_handler;
-$SIG{'__DIE__'} = \&sig_die_handler;
$SIG{'USR1'} = 'IGNORE';
sub check_key_and_xml_validity {