X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-si%2Fmodules%2FGosaSupportDaemon.pm;h=7d769c08ad6ff4e302a900203e214f955cb2b16c;hb=bc18340d72a93568de1eb69137ff8565bcf4262f;hp=d6420a1424ac75ff010c9b204ab848f209786087;hpb=d97cf1eb29de4f01ee308bc11c97094b9fba2147;p=gosa.git diff --git a/gosa-si/modules/GosaSupportDaemon.pm b/gosa-si/modules/GosaSupportDaemon.pm index d6420a142..7d769c08a 100644 --- a/gosa-si/modules/GosaSupportDaemon.pm +++ b/gosa-si/modules/GosaSupportDaemon.pm @@ -46,6 +46,7 @@ use IO::Socket::INET; use Crypt::Rijndael; use Digest::MD5 qw(md5 md5_hex md5_base64); use MIME::Base64; +use XML::Quote qw(:all); use XML::Simple; use Data::Dumper; use Net::DNS; @@ -130,7 +131,8 @@ sub _transformHashToString { } elsif ( ref $content eq "ARRAY") { $s .= &_transformArrayToString($tag, $content); } else { - $s .= "<$tag>".$content.""; + $content = defined $content ? $content : ""; + $s .= "<$tag>".&xml_quote($content).""; } } return $s; @@ -143,7 +145,8 @@ sub _transformArrayToString { if (ref $content eq "HASH") { $s .= "<$tag>".&_transformHashToString($content).""; } else { - $s .= "<$tag>$content"; + $content = defined $content ? $content : ""; + $s .= "<$tag>".&xml_quote($content).""; } } return $s; @@ -684,6 +687,15 @@ sub get_ip { sub get_interface_for_ip { my $result; my $ip= shift; + + if($ip =~ /^[a-z]/i) { + my $ip_address = inet_ntoa(scalar gethostbyname($ip)); + if(defined($ip_address) && $ip_address =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) { + # Write ip address to $source variable + $ip = $ip_address; + } + } + if ($ip && length($ip) > 0) { my @ifs= &get_interfaces(); if($ip eq "0.0.0.0") {