summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cc31169)
raw | patch | inline | side by side (parent: cc31169)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 6 Feb 2008 16:38:14 +0000 (16:38 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 6 Feb 2008 16:38:14 +0000 (16:38 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8761 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/tests/client.php | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index a3764f4cdedf481179965270c7f6985acd88669c..e03855aa65a5631a58ed04801192914f9f18e27c 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
# for each answer in answer list
foreach my $answer ( @{$answer_l} ) {
-
-
-
-
my $error = 0;
# check answer if gosa-si envelope conform
my $answer_hash = $xml->XMLin($answer, ForceArray=>1);
&send_msg_to_target($answer, $host_name, $host_key, $answer_header);
}
}
+ elsif( $answer_target =~ /([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})/ ) {
+ daemon_log("target is mac address '$answer_target', looking for host in known_clients", 3);
+ my $sql_statement = "SELECT * FROM known_clients WHERE macaddress='$answer_target'";
+ my $query_res = $known_clients_db->select_dbentry( $sql_statement );
+ my $found_ip_flag = 0;
+ while( my ($hit_num, $hit) = each %{ $query_res } ) {
+ my $host_name = $hit->{hostname};
+ my $host_key = $hit->{hostkey};
+ $answer =~ s/$answer_target/$host_name/g;
+ daemon_log("found host '$host_name', assoziated to '$answer_target'", 3);
+ &send_msg_to_target($answer, $host_name, $host_key, $answer_header);
+ $found_ip_flag++ ;
+ }
+ if( $found_ip_flag == 0) {
+ daemon_log("ERROR: no host found in known_clients with mac address '$answer_target', answer could not be send", 1);
+ }
+ }
else {
# answer is for one specific host
# get encrypt_key
my $encrypt_key = &get_encrypt_key($answer_target);
if( !$encrypt_key ) {
- daemon_log("ERROR: no encrypt key found for answer target '$answer_target'", 1);
+ daemon_log("ERROR: no encrypt key found in known_clients or known_server for target '$answer_target'", 1);
daemon_log("\n$answer", 8);
next;
}
index 879de7550bd9bd871cf4b1fe0c953cd81eb44f91..ff33d537da1f0d0a9d94983d494941b2a33f16b5 100755 (executable)
--- a/gosa-si/tests/client.php
+++ b/gosa-si/tests/client.php
#$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>";
+$data = "<xml> <header>gosa_new_key_for_client</header> <target>00:01:6c:9d:b9:fa</target> <source>10.89.1.31:20081</source> </xml>";
$sock->write($data);