From 1dbe7d77f7bde129b3390f9b3f8c85cd822518ae Mon Sep 17 00:00:00 2001 From: William Brown Date: Thu, 26 Nov 2015 13:11:17 +1000 Subject: [PATCH] Ticket 48332 - allow users to specify to relax the FQDN constraint https://fedorahosted.org/389/ticket/48332 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. Author: wibrown Review by: ??? --- ldap/admin/src/scripts/DSCreate.pm.in | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in index e04d90d..d449b02 100644 --- a/ldap/admin/src/scripts/DSCreate.pm.in +++ b/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"; } -- 2.5.0