mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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 <slaznick@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
committed by
Christian Heimes
parent
c5ee8ae529
commit
ffdb20aeb3
@@ -385,6 +385,7 @@ class BasePathNamespace(object):
|
|||||||
GETENT = '/usr/bin/getent'
|
GETENT = '/usr/bin/getent'
|
||||||
SSHD = '/usr/sbin/sshd'
|
SSHD = '/usr/sbin/sshd'
|
||||||
SSSCTL = '/usr/sbin/sssctl'
|
SSSCTL = '/usr/sbin/sssctl'
|
||||||
|
LIBARCH = "64"
|
||||||
|
|
||||||
|
|
||||||
paths = BasePathNamespace()
|
paths = BasePathNamespace()
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class DebianPathNamespace(BasePathNamespace):
|
|||||||
UPDATE_CA_TRUST = "/usr/sbin/update-ca-certificates"
|
UPDATE_CA_TRUST = "/usr/sbin/update-ca-certificates"
|
||||||
BIND_LDAP_DNS_IPA_WORKDIR = "/var/cache/bind/dyndb-ldap/ipa/"
|
BIND_LDAP_DNS_IPA_WORKDIR = "/var/cache/bind/dyndb-ldap/ipa/"
|
||||||
BIND_LDAP_DNS_ZONE_WORKDIR = "/var/cache/bind/dyndb-ldap/ipa/master/"
|
BIND_LDAP_DNS_ZONE_WORKDIR = "/var/cache/bind/dyndb-ldap/ipa/master/"
|
||||||
|
LIBARCH = "/{0}".format(MULTIARCH)
|
||||||
LIBSOFTHSM2_SO = "/usr/lib/softhsm/libsofthsm2.so"
|
LIBSOFTHSM2_SO = "/usr/lib/softhsm/libsofthsm2.so"
|
||||||
PAM_KRB5_SO = "/usr/lib/{0}/security/pam_krb5.so".format(MULTIARCH)
|
PAM_KRB5_SO = "/usr/lib/{0}/security/pam_krb5.so".format(MULTIARCH)
|
||||||
LIB_SYSTEMD_SYSTEMD_DIR = "/lib/systemd/system/"
|
LIB_SYSTEMD_SYSTEMD_DIR = "/lib/systemd/system/"
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import base64
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
import uuid
|
import uuid
|
||||||
import platform
|
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
import pwd
|
import pwd
|
||||||
@@ -276,7 +275,6 @@ class LDAPUpdate(object):
|
|||||||
self.ldapuri = installutils.realm_to_ldapi_uri(self.realm)
|
self.ldapuri = installutils.realm_to_ldapi_uri(self.realm)
|
||||||
if suffix is not None:
|
if suffix is not None:
|
||||||
assert isinstance(suffix, DN)
|
assert isinstance(suffix, DN)
|
||||||
libarch = self._identify_arch()
|
|
||||||
|
|
||||||
fqdn = installutils.get_fqdn()
|
fqdn = installutils.get_fqdn()
|
||||||
if fqdn is None:
|
if fqdn is None:
|
||||||
@@ -293,7 +291,7 @@ class LDAPUpdate(object):
|
|||||||
if not self.sub_dict.get("ESCAPED_SUFFIX"):
|
if not self.sub_dict.get("ESCAPED_SUFFIX"):
|
||||||
self.sub_dict["ESCAPED_SUFFIX"] = str(suffix)
|
self.sub_dict["ESCAPED_SUFFIX"] = str(suffix)
|
||||||
if not self.sub_dict.get("LIBARCH"):
|
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"):
|
if not self.sub_dict.get("TIME"):
|
||||||
self.sub_dict["TIME"] = int(time.time())
|
self.sub_dict["TIME"] = int(time.time())
|
||||||
if not self.sub_dict.get("MIN_DOMAIN_LEVEL"):
|
if not self.sub_dict.get("MIN_DOMAIN_LEVEL"):
|
||||||
@@ -323,18 +321,6 @@ class LDAPUpdate(object):
|
|||||||
else:
|
else:
|
||||||
raise RuntimeError("Offline updates are not supported.")
|
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):
|
def _template_str(self, s):
|
||||||
try:
|
try:
|
||||||
return ipautil.template_str(s, self.sub_dict)
|
return ipautil.template_str(s, self.sub_dict)
|
||||||
|
|||||||
Reference in New Issue
Block a user