From 6023521dcd649a4829942c27d87f4bb7924e016d Mon Sep 17 00:00:00 2001 From: janw Date: Thu, 27 Nov 2008 13:20:35 +0000 Subject: [PATCH] Check Array beforge accessing. Closes #588 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13056 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-client | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index b7a20565a..8a77d3865 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -1191,12 +1191,12 @@ if( defined $server_check ) { my @tmp_servers; if ( !$server_domain) { # Try our DNS Searchlist - my @domain_list = &get_dns_domains(); - my $tmp_domains; - my $error_string; + my @domain_list = &get_dns_domains(); + my $tmp_domains; + my $error_string; for my $domain (@domain_list) { chomp($domain); - ($tmp_domains, $error_string) = &get_server_addresses($domain); + ($tmp_domains, $error_string) = &get_server_addresses($domain); if(@$tmp_domains) { for my $tmp_server(@$tmp_domains) { push @tmp_servers, $tmp_server; @@ -1204,11 +1204,11 @@ if( defined $server_check ) { } } if (0 == @tmp_servers) { - my $log_string = "no gosa-si-server found!"; - $log_string .= "\n\tdetermined domains out of /etc/resolv.conf: ".join(", ", @domain_list); - $log_string .= "\n\tdetermined server addresses in domains: ".join(", ",@$tmp_domains); - daemon_log("ERROR: $log_string", 1); - daemon_log("ERROR: $error_string", 1); + my $log_string = "no gosa-si-server found!"; + $log_string .= "\n\tdetermined domains out of /etc/resolv.conf: ".join(", ", @domain_list) if (defined(@domain_list)); + $log_string .= "\n\tdetermined server addresses in domains: ".join(", ",@$tmp_domains) if (defined($tmp_domains)); + daemon_log("ERROR: $log_string", 1) if (defined($log_string)); + daemon_log("ERROR: $error_string", 1) if (defined($error_string)); daemon_log("ERROR: please specify a gosa-si-server address or a domain in config file", 1); kill 2, $$; } @@ -1221,11 +1221,11 @@ if( defined $server_check ) { } } - foreach my $server (@tmp_servers) { - unshift(@servers, $server); - } - my $servers_string = join(", ", @servers); - daemon_log("INFO: found servers in DNS: $servers_string", 1); + foreach my $server (@tmp_servers) { + unshift(@servers, $server); + } + my $servers_string = join(", ", @servers); + daemon_log("INFO: found servers in DNS: $servers_string", 1); } -- 2.30.2