From: rettenbe Date: Thu, 4 Sep 2008 13:05:37 +0000 (+0000) Subject: bugfix: si server addressing with mac address is not allowed X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d3c302dd5ea7111fe53f890948f1c7917ef1c509;p=gosa.git bugfix: si server addressing with mac address is not allowed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12365 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index c1fe2d63f..231fa016a 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -1066,7 +1066,7 @@ sub msg_to_decrypt { } else { $local_address = $server_address; } - + # Determine the local mac address if target is a mac address if ($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})$/i) { my $loc_ip = &get_local_ip_for_remote_ip($heap->{'remote_ip'}); diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index 0fe1127b2..16bfcee52 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -1151,14 +1151,20 @@ sub get_hosts_with_module { &add_content2xml_hash($out_hash, "host", $local_mac); } + + my $out_msg = &create_xml_string($out_hash); + # Search for opsi hosts in server_db my $sql = "SELECT * FROM $main::known_server_tn WHERE loaded_modules LIKE '%$module_name%'"; my $res = $main::known_server_db->select_dbentry($sql); while (my ($hit_id, $hit_hash) = each %$res) { - &add_content2xml_hash($out_hash, "host", $hit_hash->{'macaddress'}); + $out_msg =~ s/<\/xml>/host$hit_id<\/result> <\/xml>/; + my $host_infos = "".$hit_hash->{'hostname'}.""; + $host_infos .= " ".$hit_hash->{'macaddress'}.""; + $out_msg =~ s/<\/xml>/\n $host_infos <\/host$hit_id> \n <\/xml>/; } - return (&create_xml_string($out_hash)); + return $out_msg; } diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 302370acc..c5e2b51a3 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -77,7 +77,7 @@ for($count = 1; $count <= $zahl; $count++) #$data = "
gosa_get_client_for_login_usr
GOSA GOSA rettenbe
"; # List all si-server providing opsi - #$data = "
gosa_get_hosts_with_module
GOSA 10.3.67.111:20081 mailqueue_com
"; + #$data = "
gosa_get_hosts_with_module
GOSA 10.89.1.31:20081 mailqueue_com
"; ################## # recreate fai dbs @@ -178,11 +178,11 @@ for($count = 1; $count <= $zahl; $count++) # writing data into a mailqueue #$data = "
gosa_send_user_msg
GOSA GOSA ".base64_encode("eine wichtige nachricht")." admin polle harald 20130101235959 ".base64_encode("kaffeepause")."
"; - #$data = "
gosa_send_user_msg
00:01:6c:9d:aa:16 GOSA ".base64_encode("eine wichtige nachricht")." admin polle harald 20130101235959 ".base64_encode("kaffeepause")."
"; - #$data = "
gosa_send_user_msg
00:01:6c:9d:b9:fa GOSA ".base64_encode("eine wichtige nachricht")." admin polle harald 20130101235959 ".base64_encode("kaffeepause")."
"; + #$data = "
gosa_send_user_msg
10.89.1.30:20081 GOSA ".base64_encode("eine wichtige nachricht")." admin polle harald 20130101235959 ".base64_encode("kaffeepause")."
"; + $data = "
gosa_send_user_msg
10.89.1.30:20081 GOSA ".base64_encode("eine wichtige nachricht")." admin polle harald 20130101235959 ".base64_encode("kaffeepause")."
"; #$data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:aa:16
"; - $data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:b9:fa
"; + #$data = "
gosa_mailqueue_query
GOSA 00:01:6c:9d:b9:fa
"; # multiple xml tags msg_id are allowed #$data = "
gosa_mailqueue_hold
GOSA 00:01:6c:9d:b9:fa 99C8ABEF23
";