From e38554c0c2b8e20dfd3015bcb109fac3c9f83767 Mon Sep 17 00:00:00 2001 From: rettenbe Date: Fri, 30 May 2008 07:36:26 +0000 Subject: [PATCH] * gosa-si-server-nobus * under construction git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11118 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/debian/gosa-si-server.install | 1 + gosa-si/gosa-si-server-nobus | 51 ++++++++++++++++++++------- gosa-si/tests/client.php | 3 +- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/gosa-si/debian/gosa-si-server.install b/gosa-si/debian/gosa-si-server.install index 920b87f38..4a6fa4af7 100644 --- a/gosa-si/debian/gosa-si-server.install +++ b/gosa-si/debian/gosa-si-server.install @@ -11,6 +11,7 @@ server/events/gosaTriggered.pm usr/lib/gosa-si/server/GosaPackages server/events/siTriggered.pm usr/lib/gosa-si/server/ClientPackages server/events/clMessages.pm usr/lib/gosa-si/server/ClientPackages server/events/databases.pm usr/lib/gosa-si/server/GosaPackages +server/events/databases.pm usr/lib/gosa-si/server/ServerPackages server/events/krb5.pm usr/lib/gosa-si/server/GosaPackages server/events/logHandling.pm usr/lib/gosa-si/server/ClientPackages server/events/server_server_com.pm usr/lib/gosa-si/server/ServerPackages diff --git a/gosa-si/gosa-si-server-nobus b/gosa-si/gosa-si-server-nobus index ac627c659..6562c2e80 100755 --- a/gosa-si/gosa-si-server-nobus +++ b/gosa-si/gosa-si-server-nobus @@ -1079,6 +1079,9 @@ sub msg_to_decrypt { if (not $done) { if (($target eq $server_address) && (not exists $msg_hash->{'forward_to_gosa'})) { $done = 1; + if ($source eq "GOSA") { + $msg =~ s/<\/xml>/$server_address,$session_id<\/forward_to_gosa><\/xml>/; + } print STDERR "target is own address without forward_to_gosa-tag -> process here\n"; } } @@ -1095,6 +1098,19 @@ sub msg_to_decrypt { } } + # target ist own address with forward_to_gosa-tag not pointing to myself -> process here + if (not $done) { + my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0]; + my $gosa_at; + my $gosa_session_id; + if (($target eq $server_address) && (defined $forward_to_gosa)){ + my ($gosa_at, $gosa_session_id) = split(/,/, $forward_to_gosa); + if ($gosa_at ne $server_address) { + $done = 1; + print STDERR "target is own address with forward_to_gosa-tag not pointing to myself -> process here\n"; + } + } + } # if message should be processed here -> add message to incoming_db if ($done) { @@ -1110,25 +1126,25 @@ sub msg_to_decrypt { } - # target is own address with forward_to_gosa-tag -> forward to gosa + # target is own address with forward_to_gosa-tag pointing at myself -> forward to gosa if (not $done) { my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0]; + my $gosa_at; + my $gosa_session_id; if (($target eq $server_address) && (defined $forward_to_gosa)){ - #if( $msg =~ s/session_id=(\d+)$// ) { - # my $session_id = $1 ; - #} - #if( defined $session_id ) { - my $session_reference = $kernel->ID_id_to_session($forward_to_gosa); + my ($gosa_at, $gosa_session_id) = split(/,/, $forward_to_gosa); + if ($gosa_at eq $server_address) { + my $session_reference = $kernel->ID_id_to_session($gosa_session_id); if( defined $session_reference ) { $heap = $session_reference->get_heap(); } - #} - if(exists $heap->{'client'}) { - $msg = &encrypt_msg($msg, $GosaPackages_key); - $heap->{'client'}->put($msg); + if(exists $heap->{'client'}) { + $msg = &encrypt_msg($msg, $GosaPackages_key); + $heap->{'client'}->put($msg); + } + $done = 1; + print STDERR "target is own address with forward_to_gosa-tag pointing at myself -> forward to gosa\n"; } - $done = 1; - print STDERR "target is own address with forward_to_gosa-tag -> forward to gosa\n"; } } @@ -1147,7 +1163,7 @@ sub msg_to_decrypt { $msg =~ s/GOSA<\/source>/$server_address<\/source>/; $msg =~ s/$target<\/target>/$hostname<\/target>/; if ($source eq "GOSA") { - $msg =~ s/<\/xml>/$session_id<\/forward_to_gosa><\/xml>/; + $msg =~ s/<\/xml>/$server_address,$session_id<\/forward_to_gosa><\/xml>/; } &send_msg_to_target($msg, $regserver, $regserver_key, $header, $session_id); } @@ -1162,10 +1178,19 @@ sub msg_to_decrypt { $res = $known_server_db->select_dbentry($sql); if (keys(%$res) > 0) { my $hostkey = $res->{1}->{'hostkey'}; + + if ($source eq "GOSA") { + $msg =~ s/GOSA<\/source>/$server_address<\/source>/; + $msg =~ s/<\/xml>/$server_address,$session_id<\/forward_to_gosa><\/xml>/; + + } + &send_msg_to_target($msg, $target, $hostkey, $header, $session_id); $done = 1; print STDERR "target is a server address -> forward to server\n"; } + + } if (not $done) { diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 461ce4293..eec4b8864 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 = "
gosa_query_fai_server
GOSA 10.89.1.131:20081
"; + #$data = "
gosa_query_fai_server
GOSA 10.89.1.131:20081
"; + $data = "
gosa_query_fai_server
GOSA 10.89.1.31:20081
"; #$data = "
gosa_new_ping
00:0c:29:02:e5:4d GOSA
"; $sock->write($data); -- 2.30.2