From 9fc1dee4812d28c09ac90ac95ab7116b4fd3b8d3 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Thu, 29 May 2008 07:54:25 +0000 Subject: [PATCH] * gosa-si-server-nobus * under construction git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11093 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server-nobus | 15 +++++++++++++-- gosa-si/modules/ServerPackages.pm | 2 ++ gosa-si/tests/client.php | 3 ++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gosa-si/gosa-si-server-nobus b/gosa-si/gosa-si-server-nobus index 4fab86989..dc94baaba 100755 --- a/gosa-si/gosa-si-server-nobus +++ b/gosa-si/gosa-si-server-nobus @@ -1068,6 +1068,7 @@ sub msg_to_decrypt { if (not $done) { if (($target eq $server_address) && (not exists $msg_hash->{'forward_to_gosa'})) { $done = 1; + print STDERR "target is own address without forward_to_gosa-tag -> process here\n"; } } @@ -1077,6 +1078,7 @@ sub msg_to_decrypt { $res = $known_clients_db->select_dbentry($sql); if (keys(%$res) > 0) { $done = 1; + print STDERR "target is a client address in known_clients -> process here\n"; } } @@ -1111,7 +1113,9 @@ sub msg_to_decrypt { $heap->{'client'}->put($msg); } $done = 1; + print STDERR "target is own address with forward_to_gosa-tag -> forward to gosa\n"; } + } # target is a client address in foreign_clients -> forward to registration server @@ -1128,6 +1132,7 @@ sub msg_to_decrypt { &send_msg_to_target($msg, $regserver, $regserver_key, $header, $session_id); } $done = 1; + print STDERR "target is a client address in foreign_clients -> forward to registration server\n"; } } @@ -1139,6 +1144,7 @@ sub msg_to_decrypt { my $hostkey = $res->{1}->{'hostkey'}; &send_msg_to_target($msg, $target, $hostkey, $header, $session_id); $done = 1; + print STDERR "target is a server address -> forward to server\n"; } } @@ -1217,6 +1223,11 @@ sub process_task { if( $error == 0) { daemon_log("$session_id INFO: Incoming msg (session_id=$session_id) with header '".@{$msg_hash->{'header'}}[0]."'", 5); daemon_log("$session_id DEBUG: Processing module ".$module, 7); + + known_modules + } + + if ($error == 0) { $answer_l = &{ $module."::process_incoming_msg" }($msg, $msg_hash, $session_id); if ( 0 < @{$answer_l} ) { @@ -1264,12 +1275,12 @@ sub process_task { # targets of msg are all gosa-si-server in known_server_db elsif( $answer_target eq "KNOWN_SERVER" ) { # answer is for all server in known_server - my $sql_statement= "SELECT * FROM known_server"; + my $sql_statement= "SELECT * FROM $known_server_tn"; my $query_res = $known_server_db->select_dbentry( $sql_statement ); while( my ($hit_num, $hit) = each %{ $query_res } ) { my $host_name = $hit->{hostname}; my $host_key = $hit->{hostkey}; - $answer =~ s/KNOWN_SERVER/$host_name/g; + $answer =~ s/KNOWN_SERVER<\/target>/$host_name<\/target>/g; my $error = &send_msg_to_target($answer, $host_name, $host_key, $answer_header, $session_id); &update_jobdb_status_for_send_msgs($answer, $error); } diff --git a/gosa-si/modules/ServerPackages.pm b/gosa-si/modules/ServerPackages.pm index d70afd40e..8e6427345 100644 --- a/gosa-si/modules/ServerPackages.pm +++ b/gosa-si/modules/ServerPackages.pm @@ -63,6 +63,8 @@ sub process_incoming_msg { no strict 'refs'; @out_msg_l = &{$event_hash->{$header}."::$header"}($msg, $msg_hash, $session_id); } else { + &main::daemon_Log("$session_id ERROR: ServerPackages: no event handler defined for '$header'", 1); + @out_msg_l = (); } return @out_msg_l; diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 325c38680..135bb44a1 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -105,7 +105,8 @@ for($count = 1; $count <= $zahl; $count++) #$data = "
gosa_krb5_create_principal
00:01:6c:9d:aa:16 horst@WIRECARD.SYSGOSA666
"; #$data = "
gosa_krb5_modify_principal
00:01:6c:9d:b9:fa horst@WIRECARD.SYSGOSA666
"; - $data = "
new_ping
10.89.1.131:20081 GOSA
"; + #$data = "
new_ping
10.89.1.131:20083 GOSA
"; + $data = "
new_ping
00:0c:29:02:e5:4d GOSA
"; $sock->write($data); $answer = "nothing"; -- 2.30.2