summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e837c1b)
raw | patch | inline | side by side (parent: e837c1b)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Feb 2008 11:21:40 +0000 (11:21 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Feb 2008 11:21:40 +0000 (11:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8854 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index f909a06d0073226e5b36a86e75d856a0c22b9071..52729a954de58cba958b6f18cdc5230d6cb2a40d 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
my $msg_hash;
eval{
$msg = &decrypt_msg($crypted_msg, $module_key);
- &main::daemon_log("decrypted_msg: \n$msg", 8);
- $msg_hash = $xml->XMLin($msg, ForceArray=>1);
+ if ($msg =~ /<xml>/i){
+ &main::daemon_log("decrypted_msg: \n$msg", 8);
+ $msg_hash = $xml->XMLin($msg, ForceArray=>1);
- # check header
- my $header_l = $msg_hash->{'header'};
- if( 1 != @{$header_l} ) {
- die'header error';
- }
- my $header = @{$header_l}[0];
- if( 0 == length $header) {
- die 'header error';
- }
-
- # check source
- my $source_l = $msg_hash->{'source'};
- if( 1 != @{$source_l} ) {
- die'source error';
- }
- my $source = @{$source_l}[0];
- if( 0 == length $source) {
- die 'source error';
- }
+ # check header
+ my $header_l = $msg_hash->{'header'};
+ if( 1 != @{$header_l} ) {
+ die 'header error';
+ }
+ my $header = @{$header_l}[0];
+ if( 0 == length $header) {
+ die 'header error';
+ }
- # check target
- my $target_l = $msg_hash->{'target'};
- if( 1 != @{$target_l} ) {
- die'target error';
- }
- my $target = @{$target_l}[0];
- if( 0 == length $target) {
- die 'target error';
- }
+ # check source
+ my $source_l = $msg_hash->{'source'};
+ if( not defined @{$source_l} or 1 != @{$source_l} ) {
+ die 'source error';
+ }
+ my $source = @{$source_l}[0];
+ if( 0 == length $source) {
+ die 'source error';
+ }
+ # check target
+ my $target_l = $msg_hash->{'target'};
+ if( 1 != @{$target_l} ) {
+ die'target error';
+ }
+ my $target = @{$target_l}[0];
+ if( 0 == length $target) {
+ die 'target error';
+ }
+ }
};
if($@) {
&main::daemon_log("WARNING: do not understand the message", 5);
my %act_modules = %$known_modules;
while( my ($mod, $info) = each(%act_modules)) {
- # check a key exists for this module
-
-
-print STDERR "SIPackages_key:$SIPackages_key\n";
-
+ # check a key exists for this module
my $module_key = ${$mod."_key"};
if( ! $module_key ) {
daemon_log("ERROR: no key specified in config file for $mod", 1);
my $error = 0;
# target can be in known_server
- if( !$encrypt_key ) {
+ if( not defined $encrypt_key ) {
my $sql_statement= "SELECT * FROM known_server WHERE hostname='$target'";
my $query_res = $known_server_db->select_dbentry( $sql_statement );
while( my ($hit_num, $hit) = each %{ $query_res } ) {
# target can be in known_client
- if( !$encrypt_key ) {
+ if( not defined $encrypt_key ) {
my $sql_statement= "SELECT * FROM known_clients WHERE hostname='$target'";
my $query_res = $known_clients_db->select_dbentry( $sql_statement );
while( my ($hit_num, $hit) = each %{ $query_res } ) {