From 875e33d9f2bcdbf8bf1ae23a269fd22df2f2ba12 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Fri, 13 May 2022 14:55:54 +0300 Subject: [PATCH] Support dnssec utils from bind 9.17.2+ In bind 9.17.2+ all dnssec utilities were moved to /usr/bin with commit 4419606c9d2a52536a6dd0882ac0c7068ac27f30. Since we only use those utilities in the specialized tool, do a fixup of the paths in the tool. Fixes: https://pagure.io/freeipa/issue/9157 Signed-off-by: Alexander Bokovoy Reviewed-By: Francisco Trivino --- daemons/dnssec/ipa-dnskeysyncd.in | 12 ++++++++++++ ipaplatform/base/paths.py | 1 + 2 files changed, 13 insertions(+) diff --git a/daemons/dnssec/ipa-dnskeysyncd.in b/daemons/dnssec/ipa-dnskeysyncd.in index 13e6ac7f2..6023abdbe 100644 --- a/daemons/dnssec/ipa-dnskeysyncd.in +++ b/daemons/dnssec/ipa-dnskeysyncd.in @@ -22,6 +22,18 @@ from ipaserver.dnssec.keysyncer import KeySyncer logger = logging.getLogger(os.path.basename(__file__)) +def fixup_dnssec_utils(self): + try: + os.stat(self.DNSSEC_KEYFROMLABEL) + except FileNotFoundError: + try: + os.stat(self.DNSSEC_KEYFROMLABEL_9_17) + except FileNotFoundError: + pass + else: + self.DNSSEC_KEYFROMLABEL = self.DNSSEC_KEYFROMLABEL_9_17 + +fixup_dnssec_utils(paths) # IPA framework initialization standard_logging_setup(debug=True) api.bootstrap(context='dns', confdir=paths.ETC_IPA, in_server=True) diff --git a/ipaplatform/base/paths.py b/ipaplatform/base/paths.py index 3cca07268..7875d6fe2 100644 --- a/ipaplatform/base/paths.py +++ b/ipaplatform/base/paths.py @@ -259,6 +259,7 @@ class BasePathNamespace: IPA_HTTPD_PASSWD_READER = "/usr/libexec/ipa/ipa-httpd-pwdreader" IPA_PKI_WAIT_RUNNING = "/usr/libexec/ipa/ipa-pki-wait-running" DNSSEC_KEYFROMLABEL = "/usr/sbin/dnssec-keyfromlabel" + DNSSEC_KEYFROMLABEL_9_17 = "/usr/bin/dnssec-keyfromlabel" GETSEBOOL = "/usr/sbin/getsebool" GROUPADD = "/usr/sbin/groupadd" USERMOD = "/usr/sbin/usermod"