From: rettenbe Date: Tue, 5 Feb 2008 16:17:37 +0000 (+0000) Subject: new server-client handshake can be triggered by GOsa X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=046591d72b19871cc3cdd40c564dab020ee1a2b4;p=gosa.git new server-client handshake can be triggered by GOsa git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8753 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/client/events/corefunctions.pm b/gosa-si/client/events/corefunctions.pm index 2dfdc8309..415342b6d 100644 --- a/gosa-si/client/events/corefunctions.pm +++ b/gosa-si/client/events/corefunctions.pm @@ -88,6 +88,10 @@ sub registered { &main::daemon_log("registration at $source",1); } + # set globaly variable client_address + my $target = @{$msg_hash->{'target'}}[0]; + $main::client_address = $target; + # set registration_flag to true my $out_hash = &create_xml_hash("registered", $main::client_address, $main::server_address); my $out_msg = &create_xml_string($out_hash); diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 2647710d8..d90279583 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -1015,10 +1015,13 @@ sub server_input { } # postprocessing if( $answer =~ "
new_key
") { +print STDERR "old key: $server_key\n"; # set new key to global variable $answer =~ /(\S*?)<\/new_key>/; my $new_key = $1; $server_key = $new_key; +print STDERR "new key: $new_key\n"; + } } diff --git a/gosa-si/modules/SIPackages.pm b/gosa-si/modules/SIPackages.pm index 6c44e134a..00def4847 100644 --- a/gosa-si/modules/SIPackages.pm +++ b/gosa-si/modules/SIPackages.pm @@ -470,7 +470,6 @@ sub new_key { "SET hostkey='$source_key', timestamp='$act_time' ". "WHERE hostname='$source_name'"; my $res = $main::known_clients_db->update_dbentry( $sql_statement ); - my $hash = &create_xml_hash("confirm_new_passwd", $server_address, $source_name); my $out_msg = &create_xml_string($hash); push(@out_msg_l, $out_msg); diff --git a/gosa-si/server/events/installation.pm b/gosa-si/server/events/installation.pm index 4c7502e7d..c6ac910fb 100644 --- a/gosa-si/server/events/installation.pm +++ b/gosa-si/server/events/installation.pm @@ -1,7 +1,7 @@ package installation; use Exporter; @ISA = qw(Exporter); -my @events = qw(get_events set_activated_for_installation reboot halt softupdate reinstall); +my @events = qw(get_events set_activated_for_installation reboot halt softupdate reinstall new_key_for_client); @EXPORT = @events; use strict; @@ -65,4 +65,14 @@ sub softupdate { return $msg; } + +sub new_key_for_client { + my ($msg, $msg_hash) = @_; + $msg =~ s/
gosa_new_key_for_client<\/header>/
new_key<\/header>/; + + return $msg; +} + + + 1; diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 3aecd1be9..879de7550 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -30,7 +30,7 @@ if($sock->connected()){ #$data = "
gosa_query_jobdb
andgt0le5
"; #$data= "
gosa_query_jobdb
ping03
"; #$data= "
gosa_query_jobdb
ping05timestamp
"; -$data= "
gosa_query_jobdb
"; +#$data= "
gosa_query_jobdb
"; # count #$data = "
gosa_count_jobdb
"; @@ -45,6 +45,7 @@ $data= "
gosa_query_jobdb
"; #$data = "
gosa_reinstall
10.89.1.31:20083 10.89.1.31:20081
"; #$data = "
gosa_softupdate
10.89.1.31:20083 10.89.1.31:20081
"; #$data = "
gosa_halt
10.89.1.31:20083 10.89.1.31:20081
"; +$data = "
gosa_new_key_for_client
10.89.1.31:20083 10.89.1.31:20081
"; $sock->write($data);