Code

If hostname is not resolvable, write goto-dns-error to fai logfile and exit.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 7 Feb 2008 09:44:56 +0000 (09:44 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 7 Feb 2008 09:44:56 +0000 (09:44 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8766 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-client

index a3e742b1545a0a5ad23428328a471699b8328f43..c11fb7679d47bae6ce8d3deb41d3c6207ba49479 100755 (executable)
@@ -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);