From ffdb20aeb31cf3b5f02f261aff11418ee3cf02d2 Mon Sep 17 00:00:00 2001 From: Timo Aaltonen Date: May 29 2018 15:03:56 +0000 Subject: ldapupdate: Add support for Debian multiarch And since Fedora 28 dropped support for non-64bit, hardcode default LIBARCH as 64. Fixes: https://pagure.io/freeipa/issue/7555 Reviewed-By: Stanislav Laznicka Reviewed-By: Christian Heimes --- diff --git a/ipaplatform/base/paths.py b/ipaplatform/base/paths.py index 7089703..3df30bd 100644 --- a/ipaplatform/base/paths.py +++ b/ipaplatform/base/paths.py @@ -385,6 +385,7 @@ class BasePathNamespace(object): GETENT = '/usr/bin/getent' SSHD = '/usr/sbin/sshd' SSSCTL = '/usr/sbin/sssctl' + LIBARCH = "64" paths = BasePathNamespace() diff --git a/ipaplatform/debian/paths.py b/ipaplatform/debian/paths.py index b6d6115..0862238 100644 --- a/ipaplatform/debian/paths.py +++ b/ipaplatform/debian/paths.py @@ -67,6 +67,7 @@ class DebianPathNamespace(BasePathNamespace): UPDATE_CA_TRUST = "/usr/sbin/update-ca-certificates" BIND_LDAP_DNS_IPA_WORKDIR = "/var/cache/bind/dyndb-ldap/ipa/" BIND_LDAP_DNS_ZONE_WORKDIR = "/var/cache/bind/dyndb-ldap/ipa/master/" + LIBARCH = "/{0}".format(MULTIARCH) LIBSOFTHSM2_SO = "/usr/lib/softhsm/libsofthsm2.so" PAM_KRB5_SO = "/usr/lib/{0}/security/pam_krb5.so".format(MULTIARCH) LIB_SYSTEMD_SYSTEMD_DIR = "/lib/systemd/system/" diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py index 7837707..395dfcf 100644 --- a/ipaserver/install/ldapupdate.py +++ b/ipaserver/install/ldapupdate.py @@ -27,7 +27,6 @@ import base64 import logging import sys import uuid -import platform import time import os import pwd @@ -276,7 +275,6 @@ class LDAPUpdate(object): self.ldapuri = installutils.realm_to_ldapi_uri(self.realm) if suffix is not None: assert isinstance(suffix, DN) - libarch = self._identify_arch() fqdn = installutils.get_fqdn() if fqdn is None: @@ -293,7 +291,7 @@ class LDAPUpdate(object): if not self.sub_dict.get("ESCAPED_SUFFIX"): self.sub_dict["ESCAPED_SUFFIX"] = str(suffix) if not self.sub_dict.get("LIBARCH"): - self.sub_dict["LIBARCH"] = libarch + self.sub_dict["LIBARCH"] = paths.LIBARCH if not self.sub_dict.get("TIME"): self.sub_dict["TIME"] = int(time.time()) if not self.sub_dict.get("MIN_DOMAIN_LEVEL"): @@ -323,18 +321,6 @@ class LDAPUpdate(object): else: raise RuntimeError("Offline updates are not supported.") - def _identify_arch(self): - """On multi-arch systems some libraries may be in /lib64, /usr/lib64, - etc. Determine if a suffix is needed based on the current - architecture. - """ - bits = platform.architecture()[0] - - if bits == "64bit": - return "64" - else: - return "" - def _template_str(self, s): try: return ipautil.template_str(s, self.sub_dict)