Changeset 2302


Ignore:
Timestamp:
11/27/19 20:03:02 (5 years ago)
Author:
nanardon
Message:

use deny booting to really lock unwant nethost

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm

    r2299 r2302  
    709709                       ? '# ' . $desc . "\n" 
    710710                        : ''; 
    711                     my ($fixedparam, $label, $netLockIp) = $retainip =~ /^\d+(\.\d+){3}$/ 
    712                         ? ('fixed-address', '', '127.0.0.1') 
    713                         : ('fixed-address6', '-6', '::1'); 
     711                    my ($fixedparam, $label) = $retainip =~ /^\d+(\.\d+){3}$/ 
     712                        ? ('fixed-address', '' ) 
     713                        : ('fixed-address6', '-6' ); 
    714714                    # If two ip are given for same protocol keep only first 
    715715                    $done{$fixedparam} and next; 
     
    719719                    $output .= sprintf("host %s-%s-%s%s {\n", $nethost, lc($fmac), $ZoneId, $label); 
    720720                    $output .= sprintf("    hardware ethernet %s;\n", $mac); 
     721                    $output .= sprintf("    $fixedparam %s;\n", $retainip) 
     722                            if ($retainip); 
    721723                    if ($obj->get_attributes('netLocked')) { 
    722                         $output .= sprintf("    $fixedparam %s;\n", $netLockIp); 
    723                     } else { 
    724                         $output .= sprintf("    $fixedparam %s;\n", $retainip) 
    725                             if ($retainip); 
     724                        $output .=     "    deny booting;" 
    726725                    } 
    727726                    $output .= "}\n\n"; 
     
    804803                        $output .= sprintf("host %s-%s-%s {\n", $nethost, lc($fmac), $ZoneId); 
    805804                        $output .= sprintf("    hardware ethernet %s;\n", $mac); 
    806                         $output .= sprintf("    fixed-address 127.0.0.1;\n"); 
     805                        $output .=         "    deny booting;" 
    807806                        $output .= "}\n\n"; 
    808807                    } 
     
    810809                        $output .= sprintf("host %s-%s-%s {\n", $nethost, lc($fmac), $ZoneId); 
    811810                        $output .= sprintf("    hardware ethernet %s;\n", $mac); 
    812                         $output .= sprintf("    fixed-address6 ::1\n"); 
     811                        $output .=         "    deny booting;" 
    813812                        $output .= "}\n\n"; 
    814813                    } 
Note: See TracChangeset for help on using the changeset viewer.