Code

new server-client handshake can be triggered by GOsa
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Feb 2008 16:17:37 +0000 (16:17 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 5 Feb 2008 16:17:37 +0000 (16:17 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8753 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/client/events/corefunctions.pm
gosa-si/gosa-si-client
gosa-si/modules/SIPackages.pm
gosa-si/server/events/installation.pm
gosa-si/tests/client.php

index 2dfdc8309fd141acdb2bcbadfbd8f1f74802afca..415342b6d3ae85729e2edc8170ca50ddc9727bba 100644 (file)
@@ -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);
index 2647710d85fd9d88a444f02bb3fe1804fd11607b..d90279583213fc3649b327fea4346c01db5f3193 100755 (executable)
@@ -1015,10 +1015,13 @@ sub server_input {
         }
         # postprocessing
         if( $answer =~ "<header>new_key</header>") {
+print STDERR "old key: $server_key\n";
             # set new key to global variable
             $answer =~ /<new_key>(\S*?)<\/new_key>/;
             my $new_key = $1;
             $server_key = $new_key;
+print STDERR "new key: $new_key\n";
+
         }
     }
 
index 6c44e134aa7c6ae02913d1447a5c374528c37f92..00def48475f2a6e23380df446f3d58e25854fcef 100644 (file)
@@ -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);
index 4c7502e7d6555a718f602e71afeae44a97fb5adf..c6ac910fbcacfd130349ef61f7d1b3b0efd3fb53 100644 (file)
@@ -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/<header>gosa_new_key_for_client<\/header>/<header>new_key<\/header>/;
+
+    return $msg;
+}
+
+
+
 1;
index 3aecd1be9024b6d868f4ba93bc368ae39e9eac1f..879de7550bd9bd871cf4b1fe0c953cd81eb44f91 100755 (executable)
@@ -30,7 +30,7 @@ if($sock->connected()){
 #$data = "<xml><header>gosa_query_jobdb</header><where><clause><connector>and</connector><phrase><operator>gt</operator><ROWID>0</ROWID></phrase><phrase><operator>le</operator><ROWID>5</ROWID></phrase></clause></where></xml>";
 #$data= "<xml><header>gosa_query_jobdb</header><where><clause><phrase><headertag>ping</headertag></phrase></clause></where><limit><from>0</from><to>3</to></limit></xml>";
 #$data= "<xml><header>gosa_query_jobdb</header><where><clause><phrase><headertag>ping</headertag></phrase></clause></where><limit><from>0</from><to>5</to></limit><orderby>timestamp</orderby></xml>";
-$data= "<xml><header>gosa_query_jobdb</header></xml>";
+#$data= "<xml><header>gosa_query_jobdb</header></xml>";
 
 # count
 #$data = "<xml> <header>gosa_count_jobdb</header></xml>";
@@ -45,6 +45,7 @@ $data= "<xml><header>gosa_query_jobdb</header></xml>";
 #$data = "<xml> <header>gosa_reinstall</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
 #$data = "<xml> <header>gosa_softupdate</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
 #$data = "<xml> <header>gosa_halt</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
+$data = "<xml> <header>gosa_new_key_for_client</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
 
 
     $sock->write($data);