Przeglądaj źródła

Ticket 48332 - allow users to specify to relax the FQDN constraint

Bug Description:  There are situations when the machine name for ds may not
match the dns name. In these cases we should allow installation without the
strict hostname checks we carry out.

Fix Description:  Add a new option, General.StrictHostCheck which defaults
to true. If true, host name checking is carried out. If false, it is disabled
and any hostname in General.FullMachineName is considered valid.

https://fedorahosted.org/389/ticket/48332

Author: wibrown

Review by: rmeggins (Thanks!)
William Brown 10 lat temu
rodzic
commit
026956c7e3
1 zmienionych plików z 16 dodań i 3 usunięć
  1. 16 3
      ldap/admin/src/scripts/DSCreate.pm.in

+ 16 - 3
ldap/admin/src/scripts/DSCreate.pm.in

@@ -126,9 +126,18 @@ sub sanityCheckParams {
         debug(0, "WARNING: The root password is less than 8 characters long.  You should choose a longer one.\n");
     }
 
-    if (@errs = checkHostname($inf->{General}->{FullMachineName}, 0)) {
-        debug(1, @errs);
-        return @errs;
+    $inf->{General}->{StrictHostCheck} = lc $inf->{General}->{StrictHostCheck};
+
+    if ("true" ne $inf->{General}->{StrictHostCheck} && "false" ne $inf->{General}->{StrictHostCheck}) {
+        debug(1, "StrictHostCheck is not a valid boolean");
+        return ('error_invalid_boolean', $inf->{General}->{StrictHostCheck});
+    }
+
+    if ($inf->{General}->{StrictHostCheck} eq "true" ) {
+        if (@errs = checkHostname($inf->{General}->{FullMachineName}, 0)) {
+            debug(1, @errs);
+            return @errs;
+        }
     }
 
     # We need to make sure this value is lowercase
@@ -903,6 +912,10 @@ sub setDefaults {
         $inf->{slapd}->{InstScriptsEnabled} = "false";
     }
 
+    if (!defined($inf->{General}->{StrictHostCheck})) {
+        $inf->{General}->{StrictHostCheck} = "true";
+    }
+
     if (!defined($inf->{slapd}->{inst_dir})) {
         $inf->{slapd}->{inst_dir} = "$inf->{General}->{ServerRoot}/slapd-$servid";
     }