From 39598292cc9a788fdb53b2c97d6efd8254c7702f Mon Sep 17 00:00:00 2001 From: janw Date: Thu, 7 Feb 2008 09:44:56 +0000 Subject: [PATCH] If hostname is not resolvable, write goto-dns-error to fai logfile and exit. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8766 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-client | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index a3e742b15..c11fb7679 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -842,6 +842,7 @@ sub register_at_gosa_si_server { if( $REGISTERED_FLAG == 1 ) { + # create new passwd and ciphering object for client-server communication $server_key = &create_passwd(); @@ -851,6 +852,15 @@ sub register_at_gosa_si_server { # fetch first gosa-si-server from @servers my $server = shift(@servers); + + # Check if our ip is resolvable - if not: don't try to register + my $ip= &get_local_ip_for_remote_ip(sprintf("%s", $server =~ /^([0-9\.]*?):.*$/)); + my $resolver= Net::DNS::Resolver->new; + my $dnsresult= $resolver->search($ip); + if(!defined($dnsresult)) { + &write_to_file("goto-dns-error:Could not resolve hostname for ip $ip", $fai_logpath); + exit(1); + } if( !$server ) { daemon_log("no gosa-si-server left in list of servers", 1); -- 2.30.2