From 64ffd117d2b4938e0935f9ea00d5eb90c0e7b3e6 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Tue, 17 Apr 2018 12:25:47 +0300 Subject: [PATCH] install: validate AD trust-related options in installers We already validate that --setup-dns is specified when any of DNS-related options provided by a user. Do the same for --setup-adtrust case. Fixes: https://pagure.io/freeipa/issue/7410 Reviewed-By: Christian Heimes --- ipaserver/install/server/__init__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ipaserver/install/server/__init__.py b/ipaserver/install/server/__init__.py index 42a35aeca..af046e80c 100644 --- a/ipaserver/install/server/__init__.py +++ b/ipaserver/install/server/__init__.py @@ -424,6 +424,27 @@ class ServerInstallInterface(ServerCertificateInstallInterface, "You cannot specify a --auto-reverse option together with " "--no-reverse") + if not self.setup_adtrust: + if self.add_agents: + raise RuntimeError( + "You cannot specify an --add-agents option without the " + "--setup-adtrust option") + + if self.enable_compat: + raise RuntimeError( + "You cannot specify an --enable-compat option without the " + "--setup-adtrust option") + + if self.netbios_name: + raise RuntimeError( + "You cannot specify a --netbios-name option without the " + "--setup-adtrust option") + + if self.no_msdcs: + raise RuntimeError( + "You cannot specify a --no-msdcs option without the " + "--setup-adtrust option") + if not hasattr(self, 'replica_file'): if self.external_cert_files and self.dirsrv_cert_files: raise RuntimeError(