Imported Upstream version 4.8.10
This commit is contained in:
Binary file not shown.
83
ipaplatform/base/constants.py
Normal file
83
ipaplatform/base/constants.py
Normal file
@@ -0,0 +1,83 @@
|
||||
#
|
||||
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
|
||||
'''
|
||||
This base platform module exports platform dependant constants.
|
||||
'''
|
||||
import sys
|
||||
|
||||
|
||||
class BaseConstantsNamespace:
|
||||
IS_64BITS = sys.maxsize > 2 ** 32
|
||||
DEFAULT_ADMIN_SHELL = '/bin/bash'
|
||||
DEFAULT_SHELL = '/bin/sh'
|
||||
DS_USER = 'dirsrv'
|
||||
DS_GROUP = 'dirsrv'
|
||||
HTTPD_USER = "apache"
|
||||
HTTPD_GROUP = "apache"
|
||||
GSSPROXY_USER = "root"
|
||||
IPA_ADTRUST_PACKAGE_NAME = "freeipa-server-trust-ad"
|
||||
IPA_DNS_PACKAGE_NAME = "freeipa-server-dns"
|
||||
KDCPROXY_USER = "kdcproxy"
|
||||
NAMED_USER = "named"
|
||||
NAMED_GROUP = "named"
|
||||
NAMED_DATA_DIR = "data/"
|
||||
NAMED_ZONE_COMMENT = ""
|
||||
PKI_USER = 'pkiuser'
|
||||
PKI_GROUP = 'pkiuser'
|
||||
# ntpd init variable used for daemon options
|
||||
NTPD_OPTS_VAR = "OPTIONS"
|
||||
# quote used for daemon options
|
||||
NTPD_OPTS_QUOTE = "\""
|
||||
ODS_USER = "ods"
|
||||
ODS_GROUP = "ods"
|
||||
# nfsd init variable used to enable kerberized NFS
|
||||
SECURE_NFS_VAR = "SECURE_NFS"
|
||||
SELINUX_BOOLEAN_ADTRUST = {
|
||||
'samba_portmapper': 'on',
|
||||
}
|
||||
SELINUX_BOOLEAN_HTTPD = {
|
||||
'httpd_can_network_connect': 'on',
|
||||
'httpd_manage_ipa': 'on',
|
||||
'httpd_run_ipa': 'on',
|
||||
'httpd_dbus_sssd': 'on',
|
||||
}
|
||||
# Unlike above, there are multiple use cases for SMB sharing
|
||||
# SELINUX_BOOLEAN_SMBSERVICE is a dictionary of dictionaries
|
||||
# to define set of booleans for each use case
|
||||
SELINUX_BOOLEAN_SMBSERVICE = {
|
||||
'share_home_dirs': {
|
||||
'samba_enable_home_dirs': 'on',
|
||||
},
|
||||
'reshare_nfs_with_samba': {
|
||||
'samba_share_nfs': 'on',
|
||||
},
|
||||
}
|
||||
SELINUX_MCS_MAX = 1023
|
||||
SELINUX_MCS_REGEX = r"^c(\d+)([.,-]c(\d+))*$"
|
||||
SELINUX_MLS_MAX = 15
|
||||
SELINUX_MLS_REGEX = r"^s(\d+)(-s(\d+))?$"
|
||||
SELINUX_USER_REGEX = r"^[a-zA-Z][a-zA-Z_\.]*$"
|
||||
SELINUX_USERMAP_DEFAULT = "unconfined_u:s0-s0:c0.c1023"
|
||||
SELINUX_USERMAP_ORDER = (
|
||||
"guest_u:s0"
|
||||
"$xguest_u:s0"
|
||||
"$user_u:s0"
|
||||
"$staff_u:s0-s0:c0.c1023"
|
||||
"$sysadm_u:s0-s0:c0.c1023"
|
||||
"$unconfined_u:s0-s0:c0.c1023"
|
||||
)
|
||||
SSSD_USER = "sssd"
|
||||
# WSGI module override, only used on Fedora
|
||||
MOD_WSGI_PYTHON2 = None
|
||||
MOD_WSGI_PYTHON3 = None
|
||||
# WSGIDaemonProcess process count. On 64bit platforms, each process
|
||||
# consumes about 110 MB RSS, from which are about 35 MB shared.
|
||||
WSGI_PROCESSES = 4 if IS_64BITS else 2
|
||||
# high ciphers without RC4, MD5, TripleDES, pre-shared key, secure
|
||||
# remote password, and DSA cert authentication.
|
||||
TLS_HIGH_CIPHERS = "HIGH:!aNULL:!eNULL:!MD5:!RC4:!3DES:!PSK:!SRP:!aDSS"
|
||||
|
||||
|
||||
constants = BaseConstantsNamespace()
|
||||
@@ -21,40 +21,44 @@
|
||||
This base platform module exports default filesystem paths.
|
||||
'''
|
||||
|
||||
import os
|
||||
|
||||
class BasePathNamespace(object):
|
||||
BASH = "/bin/bash"
|
||||
BIN_FALSE = "/bin/false"
|
||||
BIN_HOSTNAME = "/bin/hostname"
|
||||
|
||||
class BasePathNamespace:
|
||||
BIN_HOSTNAMECTL = "/bin/hostnamectl"
|
||||
ECHO = "/bin/echo"
|
||||
FIPS_MODE_SETUP = "/usr/bin/fips-mode-setup"
|
||||
GZIP = "/bin/gzip"
|
||||
LS = "/bin/ls"
|
||||
PKICREATE = "/bin/pkicreate"
|
||||
PKISILENT = "/bin/pkisilent"
|
||||
SH = "/bin/sh"
|
||||
SYSTEMCTL = "/bin/systemctl"
|
||||
SYSTEMD_DETECT_VIRT = "/usr/bin/systemd-detect-virt"
|
||||
SYSTEMD_TMPFILES = "/usr/bin/systemd-tmpfiles"
|
||||
TAR = "/bin/tar"
|
||||
BIN_TRUE = "/bin/true"
|
||||
DEV_NULL = "/dev/null"
|
||||
DEV_STDIN = "/dev/stdin"
|
||||
AUTOFS_LDAP_AUTH_CONF = "/etc/autofs_ldap_auth.conf"
|
||||
ETC_DIRSRV = "/etc/dirsrv"
|
||||
DS_KEYTAB = "/etc/dirsrv/ds.keytab"
|
||||
ETC_DIRSRV_SLAPD_INSTANCE_TEMPLATE = "/etc/dirsrv/slapd-%s"
|
||||
ETC_SLAPD_PKI_IPA_DIR = "/etc/dirsrv/slapd-PKI-IPA"
|
||||
ETC_FEDORA_RELEASE = "/etc/fedora-release"
|
||||
GROUP = "/etc/group"
|
||||
ETC_HOSTNAME = "/etc/hostname"
|
||||
HOSTS = "/etc/hosts"
|
||||
ETC_HTTPD_DIR = "/etc/httpd"
|
||||
HTTPD_ALIAS_DIR = "/etc/httpd/alias"
|
||||
ALIAS_CACERT_ASC = "/etc/httpd/alias/cacert.asc"
|
||||
ALIAS_PWDFILE_TXT = "/etc/httpd/alias/pwdfile.txt"
|
||||
GSSAPI_SESSION_KEY = "/etc/httpd/alias/ipasession.key"
|
||||
OLD_KRA_AGENT_PEM = "/etc/httpd/alias/kra-agent.pem"
|
||||
HTTPD_CONF_D_DIR = "/etc/httpd/conf.d/"
|
||||
HTTPD_IPA_KDCPROXY_CONF = "/etc/ipa/kdcproxy/ipa-kdc-proxy.conf"
|
||||
HTTPD_IPA_KDCPROXY_CONF_SYMLINK = "/etc/httpd/conf.d/ipa-kdc-proxy.conf"
|
||||
HTTPD_IPA_PKI_PROXY_CONF = "/etc/httpd/conf.d/ipa-pki-proxy.conf"
|
||||
HTTPD_IPA_REWRITE_CONF = "/etc/httpd/conf.d/ipa-rewrite.conf"
|
||||
HTTPD_IPA_CONF = "/etc/httpd/conf.d/ipa.conf"
|
||||
HTTPD_NSS_CONF = "/etc/httpd/conf.d/nss.conf"
|
||||
HTTPD_SSL_CONF = "/etc/httpd/conf.d/ssl.conf"
|
||||
IPA_KEYTAB = "/etc/httpd/conf/ipa.keytab"
|
||||
HTTPD_SSL_SITE_CONF = "/etc/httpd/conf.d/ssl.conf"
|
||||
HTTPD_CERT_FILE = "/var/lib/ipa/certs/httpd.crt"
|
||||
HTTPD_KEY_FILE = "/var/lib/ipa/private/httpd.key"
|
||||
HTTPD_PASSWD_FILE_FMT = "/var/lib/ipa/passwds/{host}-443-RSA"
|
||||
# only used on Fedora
|
||||
HTTPD_IPA_WSGI_MODULES_CONF = None
|
||||
OLD_IPA_KEYTAB = "/etc/httpd/conf/ipa.keytab"
|
||||
HTTP_KEYTAB = "/var/lib/ipa/gssproxy/http.keytab"
|
||||
HTTPD_PASSWORD_CONF = "/etc/httpd/conf/password.conf"
|
||||
IDMAPD_CONF = "/etc/idmapd.conf"
|
||||
ETC_IPA = "/etc/ipa"
|
||||
@@ -63,71 +67,111 @@ class BasePathNamespace(object):
|
||||
IPA_DNS_UPDATE_TXT = "/etc/ipa/.dns_update.txt"
|
||||
IPA_CA_CRT = "/etc/ipa/ca.crt"
|
||||
IPA_DEFAULT_CONF = "/etc/ipa/default.conf"
|
||||
IPA_DNSKEYSYNCD_KEYTAB = "/etc/ipa/dnssec/ipa-dnskeysyncd.keytab"
|
||||
IPA_ODS_EXPORTER_KEYTAB = "/etc/ipa/dnssec/ipa-ods-exporter.keytab"
|
||||
DNSSEC_SOFTHSM2_CONF = "/etc/ipa/dnssec/softhsm2.conf"
|
||||
DNSSEC_SOFTHSM_PIN_SO = "/etc/ipa/dnssec/softhsm_pin_so"
|
||||
IPA_NSSDB_DIR = "/etc/ipa/nssdb"
|
||||
IPA_NSSDB_PWDFILE_TXT = "/etc/ipa/nssdb/pwdfile.txt"
|
||||
COMMON_KRB5_CONF_DIR = "/etc/krb5.conf.d/"
|
||||
KRB5_CONF = "/etc/krb5.conf"
|
||||
KRB5_FREEIPA = COMMON_KRB5_CONF_DIR + "freeipa"
|
||||
KRB5_FREEIPA_SERVER = COMMON_KRB5_CONF_DIR + "freeipa-server"
|
||||
KRB5_KEYTAB = "/etc/krb5.keytab"
|
||||
LDAP_CONF = "/etc/ldap.conf"
|
||||
LIBNSS_LDAP_CONF = "/etc/libnss-ldap.conf"
|
||||
NAMED_CONF = "/etc/named.conf"
|
||||
NAMED_CONF_BAK = "/etc/named.conf.ipa-backup"
|
||||
NAMED_CUSTOM_CONF = "/etc/named/ipa-ext.conf"
|
||||
NAMED_CUSTOM_OPTIONS_CONF = "/etc/named/ipa-options-ext.conf"
|
||||
NAMED_CONF_SRC = '/usr/share/ipa/bind.named.conf.template'
|
||||
NAMED_CUSTOM_CONF_SRC = '/usr/share/ipa/bind.ipa-ext.conf.template'
|
||||
NAMED_CUSTOM_OPTIONS_CONF_SRC = (
|
||||
'/usr/share/ipa/bind.ipa-options-ext.conf.template'
|
||||
)
|
||||
NAMED_VAR_DIR = "/var/named"
|
||||
NAMED_KEYTAB = "/etc/named.keytab"
|
||||
NAMED_RFC1912_ZONES = "/etc/named.rfc1912.zones"
|
||||
NAMED_ROOT_KEY = "/etc/named.root.key"
|
||||
NAMED_MANAGED_KEYS_DIR = "/var/named/dynamic"
|
||||
NAMED_CRYPTO_POLICY_FILE = None
|
||||
NSLCD_CONF = "/etc/nslcd.conf"
|
||||
NSS_LDAP_CONF = "/etc/nss_ldap.conf"
|
||||
NSSWITCH_CONF = "/etc/nsswitch.conf"
|
||||
CHRONY_CONF = "/etc/chrony.conf"
|
||||
NTP_CONF = "/etc/ntp.conf"
|
||||
NTP_STEP_TICKERS = "/etc/ntp/step-tickers"
|
||||
ETC_OPENDNSSEC_DIR = "/etc/opendnssec"
|
||||
OPENDNSSEC_CONF_FILE = "/etc/opendnssec/conf.xml"
|
||||
OPENDNSSEC_KASP_FILE = "/etc/opendnssec/kasp.xml"
|
||||
OPENDNSSEC_ZONELIST_FILE = "/etc/opendnssec/zonelist.xml"
|
||||
OPENLDAP_LDAP_CONF = "/etc/openldap/ldap.conf"
|
||||
PAM_LDAP_CONF = "/etc/pam_ldap.conf"
|
||||
PASSWD = "/etc/passwd"
|
||||
ETC_PKI_CA_DIR = "/etc/pki-ca"
|
||||
SYSTEMWIDE_CA_STORE = "/etc/pki/ca-trust/source/anchors/"
|
||||
# Trusted CA certificates used to be written out to this file. In newer
|
||||
# versions of FreeIPA, it has been replaced by IPA_P11_KIT.
|
||||
SYSTEMWIDE_IPA_CA_CRT = "/etc/pki/ca-trust/source/anchors/ipa-ca.crt"
|
||||
IPA_P11_KIT = "/etc/pki/ca-trust/source/ipa.p11-kit"
|
||||
CA_CERTIFICATES_BUNDLE_PEM = None
|
||||
CA_CERTIFICATES_DIR = None
|
||||
NSS_DB_DIR = "/etc/pki/nssdb"
|
||||
NSSDB_CERT8_DB = "/etc/pki/nssdb/cert8.db"
|
||||
NSSDB_KEY3_DB = "/etc/pki/nssdb/key3.db"
|
||||
NSSDB_SECMOD_DB = "/etc/pki/nssdb/secmod.db"
|
||||
PKI_CONFIGURATION = "/etc/pki"
|
||||
PKI_TOMCAT = "/etc/pki/pki-tomcat"
|
||||
PKI_TOMCAT_ALIAS_DIR = "/etc/pki/pki-tomcat/alias/"
|
||||
PKI_TOMCAT_ALIAS_DIR = "/etc/pki/pki-tomcat/alias"
|
||||
PKI_TOMCAT_ALIAS_PWDFILE_TXT = "/etc/pki/pki-tomcat/alias/pwdfile.txt"
|
||||
PKI_TOMCAT_PASSWORD_CONF = "/etc/pki/pki-tomcat/password.conf"
|
||||
PKI_TOMCAT_SERVER_XML = "/etc/pki/pki-tomcat/server.xml"
|
||||
ETC_REDHAT_RELEASE = "/etc/redhat-release"
|
||||
RESOLV_CONF = "/etc/resolv.conf"
|
||||
SAMBA_KEYTAB = "/etc/samba/samba.keytab"
|
||||
SMB_CONF = "/etc/samba/smb.conf"
|
||||
LIMITS_CONF = "/etc/security/limits.conf"
|
||||
SSH_CONFIG_DIR = "/etc/ssh"
|
||||
SSH_CONFIG = "/etc/ssh/ssh_config"
|
||||
SSHD_CONFIG = "/etc/ssh/sshd_config"
|
||||
SSHD_IPA_CONFIG = "/etc/ssh/sshd_config.d/04-ipa.conf"
|
||||
SSHD_IPA_CONFIG_TEMPLATE = "/usr/share/ipa/client/sshd_ipa.conf.template"
|
||||
SSSD_CONF = "/etc/sssd/sssd.conf"
|
||||
SSSD_CONF_BKP = "/etc/sssd/sssd.conf.bkp"
|
||||
SSSD_CONF_DELETED = "/etc/sssd/sssd.conf.deleted"
|
||||
ETC_SYSCONFIG_DIR = "/etc/sysconfig"
|
||||
ETC_SYSCONFIG_AUTHCONFIG = "/etc/sysconfig/authconfig"
|
||||
SYSCONFIG_AUTOFS = "/etc/sysconfig/autofs"
|
||||
SYSCONFIG_DIRSRV = "/etc/sysconfig/dirsrv"
|
||||
SYSCONFIG_DIRSRV_INSTANCE = "/etc/sysconfig/dirsrv-%s"
|
||||
SYSCONFIG_DIRSRV_PKI_IPA_DIR = "/etc/sysconfig/dirsrv-PKI-IPA"
|
||||
SYSCONFIG_DIRSRV_SYSTEMD = "/etc/sysconfig/dirsrv.systemd"
|
||||
SYSCONFIG_IPA_DNSKEYSYNCD = "/etc/sysconfig/ipa-dnskeysyncd"
|
||||
SYSCONFIG_IPA_ODS_EXPORTER = "/etc/sysconfig/ipa-ods-exporter"
|
||||
SYSCONFIG_HTTPD = "/etc/sysconfig/httpd"
|
||||
SYSCONFIG_KRB5KDC_DIR = "/etc/sysconfig/krb5kdc"
|
||||
SYSCONFIG_NETWORK = "/etc/sysconfig/network"
|
||||
SYSCONFIG_NETWORK_IPABKP = "/etc/sysconfig/network.ipabkp"
|
||||
SYSCONFIG_NAMED = "/etc/sysconfig/named"
|
||||
SYSCONFIG_NFS = "/etc/sysconfig/nfs"
|
||||
SYSCONFIG_NTPD = "/etc/sysconfig/ntpd"
|
||||
SYSCONFIG_ODS = "/etc/sysconfig/ods"
|
||||
SYSCONFIG_PKI = "/etc/sysconfig/pki"
|
||||
SYSCONFIG_PKI_CA_DIR = "/etc/sysconfig/pki-ca"
|
||||
SYSCONFIG_PKI_TOMCAT = "/etc/sysconfig/pki-tomcat"
|
||||
SYSCONFIG_PKI_CA_PKI_CA_DIR = "/etc/sysconfig/pki/ca/pki-ca"
|
||||
SYSCONFIG_PKI_TOMCAT_PKI_TOMCAT_DIR = "/etc/sysconfig/pki/tomcat/pki-tomcat"
|
||||
ETC_SYSTEMD_SYSTEM_DIR = "/etc/systemd/system/"
|
||||
SYSTEMD_SYSTEM_HTTPD_D_DIR = "/etc/systemd/system/httpd.service.d/"
|
||||
SYSTEMD_SYSTEM_HTTPD_IPA_CONF = "/etc/systemd/system/httpd.service.d/ipa.conf"
|
||||
SYSTEMD_CERTMONGER_SERVICE = "/etc/systemd/system/multi-user.target.wants/certmonger.service"
|
||||
SYSTEMD_IPA_SERVICE = "/etc/systemd/system/multi-user.target.wants/ipa.service"
|
||||
SYSTEMD_SSSD_SERVICE = "/etc/systemd/system/multi-user.target.wants/sssd.service"
|
||||
SYSTEMD_PKI_TOMCAT_SERVICE = "/etc/systemd/system/pki-tomcatd.target.wants/pki-tomcatd@pki-tomcat.service"
|
||||
SYSTEMD_PKI_TOMCAT_IPA_CONF = \
|
||||
"/etc/systemd/system/pki-tomcatd@pki-tomcat.service.d/ipa.conf"
|
||||
ETC_TMPFILESD_DIRSRV = "/etc/tmpfiles.d/dirsrv-%s.conf"
|
||||
DNSSEC_TRUSTED_KEY = "/etc/trusted-key.key"
|
||||
HOME_DIR = "/home"
|
||||
PROC_FIPS_ENABLED = "/proc/sys/crypto/fips_enabled"
|
||||
ROOT_IPA_CACHE = "/root/.ipa_cache"
|
||||
ROOT_PKI = "/root/.pki"
|
||||
CA_AGENT_P12 = "/root/ca-agent.p12"
|
||||
DOGTAG_ADMIN_P12 = "/root/ca-agent.p12"
|
||||
RA_AGENT_PEM = "/var/lib/ipa/ra-agent.pem"
|
||||
RA_AGENT_KEY = "/var/lib/ipa/ra-agent.key"
|
||||
CACERT_P12 = "/root/cacert.p12"
|
||||
ROOT_IPA_CSR = "/root/ipa.csr"
|
||||
ROOT_TMP_CA_P12 = "/root/tmp-ca.p12"
|
||||
NAMED_PID = "/run/named/named.pid"
|
||||
IP = "/sbin/ip"
|
||||
NOLOGIN = "/sbin/nologin"
|
||||
SBIN_REBOOT = "/sbin/reboot"
|
||||
SBIN_RESTORECON = "/sbin/restorecon"
|
||||
@@ -136,92 +180,117 @@ class BasePathNamespace(object):
|
||||
TMP_CA_P12 = "/tmp/ca.p12"
|
||||
TMP_KRB5CC = "/tmp/krb5cc_%d"
|
||||
USR_DIR = "/usr"
|
||||
CERTMONGER_COMMAND_TEMPLATE = "/usr/%s/ipa/certmonger/%s"
|
||||
CERTMONGER_COMMAND_TEMPLATE = "/usr/libexec/ipa/certmonger/%s"
|
||||
PKCS12EXPORT = "/usr/bin/PKCS12Export"
|
||||
CERTUTIL = "/usr/bin/certutil"
|
||||
CHROMIUM_BROWSER = "/usr/bin/chromium-browser"
|
||||
DS_NEWINST_PL = "/usr/bin/ds_newinst.pl"
|
||||
FIREFOX = "/usr/bin/firefox"
|
||||
GETCERT = "/usr/bin/getcert"
|
||||
GPG = "/usr/bin/gpg"
|
||||
GPG2 = "/usr/bin/gpg2"
|
||||
GPG_CONF = "/usr/bin/gpgconf"
|
||||
GPG_CONNECT_AGENT = "/usr/bin/gpg-connect-agent"
|
||||
GPG_AGENT = "/usr/bin/gpg-agent"
|
||||
IPA_GETCERT = "/usr/bin/ipa-getcert"
|
||||
KADMIN_LOCAL = '/usr/sbin/kadmin.local'
|
||||
KDESTROY = "/usr/bin/kdestroy"
|
||||
KINIT = "/usr/bin/kinit"
|
||||
KLIST = "/usr/bin/klist"
|
||||
KTUTIL = "/usr/bin/ktutil"
|
||||
BIN_KVNO = "/usr/bin/kvno"
|
||||
LDAPMODIFY = "/usr/bin/ldapmodify"
|
||||
LDAPPASSWD = "/usr/bin/ldappasswd"
|
||||
MODUTIL = "/usr/bin/modutil"
|
||||
NET = "/usr/bin/net"
|
||||
BIN_NISDOMAINNAME = "/usr/bin/nisdomainname"
|
||||
NSUPDATE = "/usr/bin/nsupdate"
|
||||
ODS_KSMUTIL = "/usr/bin/ods-ksmutil"
|
||||
ODS_SIGNER = "/usr/sbin/ods-signer"
|
||||
ODS_ENFORCER = "/usr/sbin/ods-enforcer"
|
||||
ODS_ENFORCER_DB_SETUP = "/usr/sbin/ods-enforcer-db-setup"
|
||||
OPENSSL = "/usr/bin/openssl"
|
||||
PERL = "/usr/bin/perl"
|
||||
PK12UTIL = "/usr/bin/pk12util"
|
||||
PKI_SETUP_PROXY = "/usr/bin/pki-setup-proxy"
|
||||
PKICREATE = "/usr/bin/pkicreate"
|
||||
PKIREMOVE = "/usr/bin/pkiremove"
|
||||
PKISILENT = "/usr/bin/pkisilent"
|
||||
SETPASSWD = "/usr/bin/setpasswd"
|
||||
SIGNTOOL = "/usr/bin/signtool"
|
||||
SOFTHSM2_UTIL = "/usr/bin/softhsm2-util"
|
||||
SSLGET = "/usr/bin/sslget"
|
||||
SSS_SSH_AUTHORIZEDKEYS = "/usr/bin/sss_ssh_authorizedkeys"
|
||||
SSS_SSH_KNOWNHOSTSPROXY = "/usr/bin/sss_ssh_knownhostsproxy"
|
||||
BIN_TIMEOUT = "/usr/bin/timeout"
|
||||
UPDATE_CA_TRUST = "/usr/bin/update-ca-trust"
|
||||
BIN_WGET = "/usr/bin/wget"
|
||||
ZIP = "/usr/bin/zip"
|
||||
BIN_CURL = "/usr/bin/curl"
|
||||
BIND_LDAP_SO = "/usr/lib/bind/ldap.so"
|
||||
USR_LIB_DIRSRV = "/usr/lib/dirsrv"
|
||||
USR_LIB_SLAPD_INSTANCE_TEMPLATE = "/usr/lib/dirsrv/slapd-%s"
|
||||
USR_LIB_SLAPD_PKI_IPA_DIR = "/usr/lib/dirsrv/slapd-PKI-IPA"
|
||||
BIND_LDAP_DNS_IPA_WORKDIR = "/var/named/dyndb-ldap/ipa/"
|
||||
BIND_LDAP_DNS_ZONE_WORKDIR = "/var/named/dyndb-ldap/ipa/master/"
|
||||
LIB_FIREFOX = "/usr/lib/firefox"
|
||||
LIBSOFTHSM2_SO = "/usr/lib/pkcs11/libsofthsm2.so"
|
||||
PAM_KRB5_SO = "/usr/lib/security/pam_krb5.so"
|
||||
LIB_SYSTEMD_SYSTEMD_DIR = "/usr/lib/systemd/system/"
|
||||
BIND_LDAP_SO_64 = "/usr/lib64/bind/ldap.so"
|
||||
USR_LIB_DIRSRV_64 = "/usr/lib64/dirsrv"
|
||||
USR_LIB_DIRSRV_SLAPD_INSTANCE_DIR_TEMPLATE = "/usr/lib64/dirsrv/slapd-%s"
|
||||
SLAPD_PKI_IPA = "/usr/lib64/dirsrv/slapd-PKI-IPA"
|
||||
LIB64_FIREFOX = "/usr/lib64/firefox"
|
||||
LIBSOFTHSM2_SO_64 = "/usr/lib64/pkcs11/libsofthsm2.so"
|
||||
PAM_KRB5_SO_64 = "/usr/lib64/security/pam_krb5.so"
|
||||
LIBEXEC_CERTMONGER_DIR = "/usr/libexec/certmonger"
|
||||
DOGTAG_IPA_CA_RENEW_AGENT_SUBMIT = "/usr/libexec/certmonger/dogtag-ipa-ca-renew-agent-submit"
|
||||
DOGTAG_IPA_RENEW_AGENT_SUBMIT = "/usr/libexec/certmonger/dogtag-ipa-renew-agent-submit"
|
||||
CERTMONGER_DOGTAG_SUBMIT = "/usr/libexec/certmonger/dogtag-submit"
|
||||
IPA_SERVER_GUARD = "/usr/libexec/certmonger/ipa-server-guard"
|
||||
GENERATE_RNDC_KEY = "/usr/libexec/generate-rndc-key.sh"
|
||||
LIBEXEC_IPA_DIR = "/usr/libexec/ipa"
|
||||
IPA_DNSKEYSYNCD_REPLICA = "/usr/libexec/ipa/ipa-dnskeysync-replica"
|
||||
IPA_DNSKEYSYNCD = "/usr/libexec/ipa/ipa-dnskeysyncd"
|
||||
IPA_HTTPD_KDCPROXY = "/usr/libexec/ipa/ipa-httpd-kdcproxy"
|
||||
IPA_ODS_EXPORTER = "/usr/libexec/ipa/ipa-ods-exporter"
|
||||
IPA_PKI_RETRIEVE_KEY = "/usr/libexec/ipa/ipa-pki-retrieve-key"
|
||||
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-pkcs11"
|
||||
GETSEBOOL = "/usr/sbin/getsebool"
|
||||
GROUPADD = "/usr/sbin/groupadd"
|
||||
USERMOD = "/usr/sbin/usermod"
|
||||
HTTPD = "/usr/sbin/httpd"
|
||||
IPA_CLIENT_AUTOMOUNT = "/usr/sbin/ipa-client-automount"
|
||||
IPA_CLIENT_INSTALL = "/usr/sbin/ipa-client-install"
|
||||
IPA_DNS_INSTALL = "/usr/sbin/ipa-dns-install"
|
||||
SBIN_IPA_JOIN = "/usr/sbin/ipa-join"
|
||||
IPA_REPLICA_CONNCHECK = "/usr/sbin/ipa-replica-conncheck"
|
||||
IPA_RMKEYTAB = "/usr/sbin/ipa-rmkeytab"
|
||||
IPACTL = "/usr/sbin/ipactl"
|
||||
NTPD = "/usr/sbin/ntpd"
|
||||
NAMED = "/usr/sbin/named"
|
||||
NAMED_PKCS11 = "/usr/sbin/named-pkcs11"
|
||||
CHRONYC = "/usr/bin/chronyc"
|
||||
CHRONYD = "/usr/sbin/chronyd"
|
||||
PKIDESTROY = "/usr/sbin/pkidestroy"
|
||||
PKISPAWN = "/usr/sbin/pkispawn"
|
||||
PKI = "/usr/bin/pki"
|
||||
RESTORECON = "/usr/sbin/restorecon"
|
||||
SELINUXENABLED = "/usr/sbin/selinuxenabled"
|
||||
SETSEBOOL = "/usr/sbin/setsebool"
|
||||
SETUP_DS_PL = "/usr/sbin/setup-ds.pl"
|
||||
SMBD = "/usr/sbin/smbd"
|
||||
USERADD = "/usr/sbin/useradd"
|
||||
FONTS_DIR = "/usr/share/fonts"
|
||||
FONTS_OPENSANS_DIR = "/usr/share/fonts/open-sans"
|
||||
FONTS_FONTAWESOME_DIR = "/usr/share/fonts/fontawesome"
|
||||
USR_SHARE_IPA_DIR = "/usr/share/ipa/"
|
||||
FFEXTENSION = "/usr/share/ipa/ffextension"
|
||||
USR_SHARE_IPA_CLIENT_DIR = "/usr/share/ipa/client"
|
||||
CA_TOPOLOGY_ULDIF = "/usr/share/ipa/ca-topology.uldif"
|
||||
IPA_HTML_DIR = "/usr/share/ipa/html"
|
||||
CA_CRT = "/usr/share/ipa/html/ca.crt"
|
||||
CONFIGURE_JAR = "/usr/share/ipa/html/configure.jar"
|
||||
KERBEROSAUTH_XPI = "/usr/share/ipa/html/kerberosauth.xpi"
|
||||
KRB_CON = "/usr/share/ipa/html/krb.con"
|
||||
KRB_JS = "/usr/share/ipa/html/krb.js"
|
||||
HTML_KRB5_INI = "/usr/share/ipa/html/krb5.ini"
|
||||
HTML_KRBREALM_CON = "/usr/share/ipa/html/krbrealm.con"
|
||||
PREFERENCES_HTML = "/usr/share/ipa/html/preferences.html"
|
||||
NIS_ULDIF = "/usr/share/ipa/nis.uldif"
|
||||
IPA_PLUGINS = "/usr/share/ipa/plugins"
|
||||
SCHEMA_COMPAT_ULDIF = "/usr/share/ipa/schema_compat.uldif"
|
||||
NIS_UPDATE_ULDIF = "/usr/share/ipa/nis-update.uldif"
|
||||
SCHEMA_COMPAT_ULDIF = "/usr/share/ipa/updates/91-schema_compat.update"
|
||||
SCHEMA_COMPAT_POST_ULDIF = "/usr/share/ipa/schema_compat_post.uldif"
|
||||
IPA_JS_PLUGINS_DIR = "/usr/share/ipa/ui/js/plugins"
|
||||
UPDATES_DIR = "/usr/share/ipa/updates/"
|
||||
PKI_CONF_SERVER_XML = "/usr/share/pki/ca/conf/server.xml"
|
||||
CACHE_IPA_SESSIONS = "/var/cache/ipa/sessions"
|
||||
DICT_WORDS = "/usr/share/dict/words"
|
||||
VAR_KERBEROS_KRB5KDC_DIR = "/var/kerberos/krb5kdc/"
|
||||
VAR_KRB5KDC_K5_REALM = "/var/kerberos/krb5kdc/.k5."
|
||||
CACERT_PEM = "/var/kerberos/krb5kdc/cacert.pem"
|
||||
KRB5KDC_KADM5_ACL = "/var/kerberos/krb5kdc/kadm5.acl"
|
||||
KRB5KDC_KADM5_KEYTAB = "/var/kerberos/krb5kdc/kadm5.keytab"
|
||||
KRB5KDC_KDC_CONF = "/var/kerberos/krb5kdc/kdc.conf"
|
||||
KDC_PEM = "/var/kerberos/krb5kdc/kdc.pem"
|
||||
KDC_CERT = "/var/kerberos/krb5kdc/kdc.crt"
|
||||
KDC_KEY = "/var/kerberos/krb5kdc/kdc.key"
|
||||
VAR_LIB = "/var/lib"
|
||||
AUTHCONFIG_LAST = "/var/lib/authconfig/last"
|
||||
VAR_LIB_CERTMONGER_DIR = "/var/lib/certmonger"
|
||||
@@ -230,67 +299,165 @@ class BasePathNamespace(object):
|
||||
CERTMONGER_REQUESTS_DIR = "/var/lib/certmonger/requests/"
|
||||
VAR_LIB_DIRSRV = "/var/lib/dirsrv"
|
||||
DIRSRV_BOOT_LDIF = "/var/lib/dirsrv/boot.ldif"
|
||||
VAR_LIB_DIRSRV_INSTANCE_SCRIPTS_TEMPLATE = "/var/lib/dirsrv/scripts-%s"
|
||||
VAR_LIB_SLAPD_INSTANCE_DIR_TEMPLATE = "/var/lib/dirsrv/slapd-%s"
|
||||
SLAPD_INSTANCE_BACKUP_DIR_TEMPLATE = "/var/lib/dirsrv/slapd-%s/bak/%s"
|
||||
IPACA_DIRSRV_INSTANCE_DB_TEMPLATE = "/var/lib/dirsrv/slapd-%s/db/ipaca"
|
||||
SLAPD_INSTANCE_LDIF_DIR_TEMPLATE = "/var/lib/dirsrv/slapd-%s/ldif"
|
||||
VAR_LIB_SLAPD_PKI_IPA_DIR_TEMPLATE = "/var/lib/dirsrv/slapd-PKI-IPA"
|
||||
VAR_LIB_IPA = "/var/lib/ipa"
|
||||
IPA_CLIENT_SYSRESTORE = "/var/lib/ipa-client/sysrestore"
|
||||
SYSRESTORE_INDEX = "/var/lib/ipa-client/sysrestore/sysrestore.index"
|
||||
IPA_BACKUP_DIR = "/var/lib/ipa/backup"
|
||||
IPA_DNSSEC_DIR = "/var/lib/ipa/dnssec"
|
||||
IPA_KASP_DB_BACKUP = "/var/lib/ipa/ipa-kasp.db.backup"
|
||||
DNSSEC_TOKENS_DIR = "/var/lib/ipa/dnssec/tokens"
|
||||
DNSSEC_SOFTHSM_PIN = "/var/lib/ipa/dnssec/softhsm_pin"
|
||||
IPA_CA_CSR = "/var/lib/ipa/ca.csr"
|
||||
IPA_CACERT_MANAGE = "/usr/sbin/ipa-cacert-manage"
|
||||
IPA_CERTUPDATE = "/usr/sbin/ipa-certupdate"
|
||||
PKI_CA_PUBLISH_DIR = "/var/lib/ipa/pki-ca/publish"
|
||||
REPLICA_INFO_TEMPLATE = "/var/lib/ipa/replica-info-%s"
|
||||
REPLICA_INFO_GPG_TEMPLATE = "/var/lib/ipa/replica-info-%s.gpg"
|
||||
SYSRESTORE = "/var/lib/ipa/sysrestore"
|
||||
STATEFILE_DIR = "/var/lib/ipa/sysupgrade"
|
||||
VAR_LIB_KDCPROXY = "/var/lib/kdcproxy"
|
||||
VAR_LIB_PKI_DIR = "/var/lib/pki"
|
||||
VAR_LIB_PKI_CA_DIR = "/var/lib/pki-ca"
|
||||
PKI_ALIAS_CA_P12 = "/var/lib/pki-ca/alias/ca.p12"
|
||||
VAR_LIB_PKI_CA_ALIAS_DIR = "/var/lib/pki-ca/alias"
|
||||
VAR_LIB_PKI_TOMCAT_DIR = "/var/lib/pki/pki-tomcat"
|
||||
CA_BACKUP_KEYS_P12 = "/var/lib/pki/pki-tomcat/alias/ca_backup_keys.p12"
|
||||
SAMBA_DIR = "/var/lib/samba/"
|
||||
KRA_BACKUP_KEYS_P12 = "/var/lib/pki/pki-tomcat/alias/kra_backup_keys.p12"
|
||||
CA_CS_CFG_PATH = "/var/lib/pki/pki-tomcat/conf/ca/CS.cfg"
|
||||
CASIGNEDLOGCERT_CFG = (
|
||||
"/var/lib/pki/pki-tomcat/ca/profiles/ca/caSignedLogCert.cfg")
|
||||
KRA_CS_CFG_PATH = "/var/lib/pki/pki-tomcat/conf/kra/CS.cfg"
|
||||
KRACERT_P12 = "/root/kracert.p12"
|
||||
SAMBA_DIR = "/var/lib/samba"
|
||||
SSSD_DB = "/var/lib/sss/db"
|
||||
SSSD_MC_GROUP = "/var/lib/sss/mc/group"
|
||||
SSSD_MC_PASSWD = "/var/lib/sss/mc/passwd"
|
||||
SSSD_PUBCONF_DIR = "/var/lib/sss/pubconf"
|
||||
SSSD_PUBCONF_KNOWN_HOSTS = "/var/lib/sss/pubconf/known_hosts"
|
||||
SSSD_PUBCONF_KRB5_INCLUDE_D_DIR = "/var/lib/sss/pubconf/krb5.include.d/"
|
||||
DIRSRV_LOCK_DIR = "/var/lock/dirsrv"
|
||||
SLAPD_INSTANCE_LOCK_TEMPLATE = "/var/lock/dirsrv/slapd-%s"
|
||||
VAR_LOG_DIRSRV_INSTANCE_TEMPLATE = "/var/log/dirsrv/slapd-%s"
|
||||
SLAPD_INSTANCE_ACCESS_LOG_TEMPLATE = "/var/log/dirsrv/slapd-%s/access"
|
||||
SLAPD_INSTANCE_ERROR_LOG_TEMPLATE = "/var/log/dirsrv/slapd-%s/errors"
|
||||
VAR_LOG_SLAPD_PKI_IPA_DIR = "/var/log/dirsrv/slapd-PKI-IPA"
|
||||
VAR_LOG_AUDIT = "/var/log/audit/audit.log"
|
||||
VAR_LOG_HTTPD_DIR = "/var/log/httpd"
|
||||
VAR_LOG_HTTPD_ERROR = "/var/log/httpd/error_log"
|
||||
IPABACKUP_LOG = "/var/log/ipabackup.log"
|
||||
IPACLIENT_INSTALL_LOG = "/var/log/ipaclient-install.log"
|
||||
IPACLIENT_UNINSTALL_LOG = "/var/log/ipaclient-uninstall.log"
|
||||
IPACLIENTSAMBA_INSTALL_LOG = "/var/log/ipaclientsamba-install.log"
|
||||
IPACLIENTSAMBA_UNINSTALL_LOG = "/var/log/ipaclientsamba-uninstall.log"
|
||||
IPAREPLICA_CA_INSTALL_LOG = "/var/log/ipareplica-ca-install.log"
|
||||
IPAREPLICA_CONNCHECK_LOG = "/var/log/ipareplica-conncheck.log"
|
||||
IPAREPLICA_INSTALL_LOG = "/var/log/ipareplica-install.log"
|
||||
IPARESTORE_LOG = "/var/log/iparestore.log"
|
||||
IPASERVER_INSTALL_LOG = "/var/log/ipaserver-install.log"
|
||||
IPASERVER_KRA_INSTALL_LOG = "/var/log/ipaserver-kra-install.log"
|
||||
IPASERVER_UNINSTALL_LOG = "/var/log/ipaserver-uninstall.log"
|
||||
IPAUPGRADE_LOG = "/var/log/ipaupgrade.log"
|
||||
IPATRUSTENABLEAGENT_LOG = "/var/log/ipatrust-enable-agent.log"
|
||||
IPAEPN_LOG = "/var/log/ipaepn.log"
|
||||
KADMIND_LOG = "/var/log/kadmind.log"
|
||||
KRB5KDC_LOG = "/var/log/krb5kdc.log"
|
||||
MESSAGES = "/var/log/messages"
|
||||
PKI_CA_LOG_DIR = "/var/log/pki-ca"
|
||||
PKI_CA_INSTALL_LOG = "/var/log/pki-ca-install.log"
|
||||
PKI_CA_UNINSTALL_LOG = "/var/log/pki-ca-uninstall.log"
|
||||
VAR_LOG_PKI_DIR = "/var/log/pki/"
|
||||
BIN_TOMCAT = "/usr/sbin/tomcat"
|
||||
TOMCAT_TOPLEVEL_DIR = "/var/log/pki/pki-tomcat"
|
||||
TOMCAT_CA_DIR = "/var/log/pki/pki-tomcat/ca"
|
||||
TOMCAT_CA_ARCHIVE_DIR = "/var/log/pki/pki-tomcat/ca/archive"
|
||||
TOMCAT_SIGNEDAUDIT_DIR = "/var/log/pki/pki-tomcat/ca/signedAudit"
|
||||
TOMCAT_KRA_DIR = "/var/log/pki/pki-tomcat/kra"
|
||||
TOMCAT_KRA_ARCHIVE_DIR = "/var/log/pki/pki-tomcat/kra/archive"
|
||||
TOMCAT_KRA_SIGNEDAUDIT_DIR = "/var/log/pki/pki-tomcat/kra/signedAudit"
|
||||
LOG_SECURE = "/var/log/secure"
|
||||
VAR_LOG_SSSD_DIR = "/var/log/sssd"
|
||||
NAMED_RUN = "/var/named/data/named.run"
|
||||
VAR_RUN_DIRSRV_DIR = "/var/run/dirsrv"
|
||||
SVC_LIST_FILE = "/var/run/ipa/services.list"
|
||||
IPA_MEMCACHED_DIR = "/var/run/ipa_memcached"
|
||||
VAR_RUN_IPA_MEMCACHED = "/var/run/ipa_memcached/ipa_memcached"
|
||||
KRB5CC_SAMBA = "/var/run/samba/krb5cc_samba"
|
||||
SLAPD_INSTANCE_SOCKET_TEMPLATE = "/var/run/slapd-%s.socket"
|
||||
ALL_SLAPD_INSTANCE_SOCKETS = "/var/run/slapd-*.socket"
|
||||
VAR_OPENDNSSEC_DIR = "/var/opendnssec"
|
||||
OPENDNSSEC_KASP_DB = "/var/opendnssec/kasp.db"
|
||||
IPA_ODS_EXPORTER_CCACHE = "/var/opendnssec/tmp/ipa-ods-exporter.ccache"
|
||||
VAR_RUN_DIRSRV_DIR = "/run/dirsrv"
|
||||
IPA_CCACHES = "/run/ipa/ccaches"
|
||||
HTTP_CCACHE = "/var/lib/ipa/gssproxy/http.ccache"
|
||||
CA_BUNDLE_PEM = "/var/lib/ipa-client/pki/ca-bundle.pem"
|
||||
KDC_CA_BUNDLE_PEM = "/var/lib/ipa-client/pki/kdc-ca-bundle.pem"
|
||||
IPA_RENEWAL_LOCK = "/run/ipa/renewal.lock"
|
||||
SVC_LIST_FILE = "/run/ipa/services.list"
|
||||
KRB5CC_SAMBA = "/run/samba/krb5cc_samba"
|
||||
SLAPD_INSTANCE_SOCKET_TEMPLATE = "/run/slapd-%s.socket"
|
||||
ADMIN_CERT_PATH = '/root/.dogtag/pki-tomcat/ca_admin.cert'
|
||||
ENTROPY_AVAIL = '/proc/sys/kernel/random/entropy_avail'
|
||||
KDCPROXY_CONFIG = '/etc/ipa/kdcproxy/kdcproxy.conf'
|
||||
CERTMONGER = '/usr/sbin/certmonger'
|
||||
NETWORK_MANAGER_CONFIG_DIR = '/etc/NetworkManager/conf.d'
|
||||
NETWORK_MANAGER_IPA_CONF = '/etc/NetworkManager/conf.d/zzz-ipa.conf'
|
||||
SYSTEMD_RESOLVED_IPA_CONF = '/etc/systemd/resolved.conf.d/zzz-ipa.conf'
|
||||
IPA_CUSTODIA_CONF_DIR = '/etc/ipa/custodia'
|
||||
IPA_CUSTODIA_CONF = '/etc/ipa/custodia/custodia.conf'
|
||||
IPA_CUSTODIA_KEYS = '/etc/ipa/custodia/server.keys'
|
||||
IPA_CUSTODIA_SOCKET = '/run/httpd/ipa-custodia.sock'
|
||||
IPA_CUSTODIA_AUDIT_LOG = '/var/log/ipa-custodia.audit.log'
|
||||
IPA_CUSTODIA_HANDLER = "/usr/libexec/ipa/custodia"
|
||||
IPA_GETKEYTAB = '/usr/sbin/ipa-getkeytab'
|
||||
EXTERNAL_SCHEMA_DIR = '/usr/share/ipa/schema.d'
|
||||
GSSPROXY_CONF = '/etc/gssproxy/10-ipa.conf'
|
||||
KRB5CC_HTTPD = '/tmp/krb5cc-httpd'
|
||||
IF_INET6 = '/proc/net/if_inet6'
|
||||
WSGI_PREFIX_DIR = "/run/httpd/wsgi"
|
||||
AUTHCONFIG = None
|
||||
AUTHSELECT = None
|
||||
SYSCONF_NETWORK = None
|
||||
ETC_PKCS11_MODULES_DIR = "/etc/pkcs11/modules"
|
||||
# 389 DS related commands.
|
||||
DSCREATE = '/usr/sbin/dscreate'
|
||||
DSCTL = '/usr/sbin/dsctl'
|
||||
DSCONF = '/usr/sbin/dsconf'
|
||||
# DS related constants
|
||||
ETC_DIRSRV = "/etc/dirsrv"
|
||||
DS_KEYTAB = "/etc/dirsrv/ds.keytab"
|
||||
ETC_DIRSRV_SLAPD_INSTANCE_TEMPLATE = "/etc/dirsrv/slapd-%s"
|
||||
USR_LIB_DIRSRV = "/usr/lib/dirsrv"
|
||||
USR_LIB_DIRSRV_64 = "/usr/lib64/dirsrv"
|
||||
VAR_LIB_DIRSRV_INSTANCE_SCRIPTS_TEMPLATE = "/var/lib/dirsrv/scripts-%s"
|
||||
VAR_LIB_SLAPD_INSTANCE_DIR_TEMPLATE = "/var/lib/dirsrv/slapd-%s"
|
||||
SLAPD_INSTANCE_BACKUP_DIR_TEMPLATE = "/var/lib/dirsrv/slapd-%s/bak/%s"
|
||||
SLAPD_INSTANCE_DB_DIR_TEMPLATE = "/var/lib/dirsrv/slapd-%s/db/%s"
|
||||
SLAPD_INSTANCE_LDIF_DIR_TEMPLATE = "/var/lib/dirsrv/slapd-%s/ldif"
|
||||
DIRSRV_LOCK_DIR = "/run/lock/dirsrv"
|
||||
ALL_SLAPD_INSTANCE_SOCKETS = "/run/slapd-*.socket"
|
||||
VAR_LOG_DIRSRV_INSTANCE_TEMPLATE = "/var/log/dirsrv/slapd-%s"
|
||||
VAR_LOG_DIRSRV = "/var/log/dirsrv/"
|
||||
SLAPD_INSTANCE_ACCESS_LOG_TEMPLATE = "/var/log/dirsrv/slapd-%s/access"
|
||||
SLAPD_INSTANCE_ERROR_LOG_TEMPLATE = "/var/log/dirsrv/slapd-%s/errors"
|
||||
SLAPD_INSTANCE_AUDIT_LOG_TEMPLATE = "/var/log/dirsrv/slapd-%s/audit"
|
||||
SLAPD_INSTANCE_SYSTEMD_IPA_ENV_TEMPLATE = \
|
||||
"/etc/systemd/system/dirsrv@%s.service.d/ipa-env.conf"
|
||||
IPA_SERVER_UPGRADE = '/usr/sbin/ipa-server-upgrade'
|
||||
KEYCTL = '/bin/keyctl'
|
||||
GETENT = '/usr/bin/getent'
|
||||
SSHD = '/usr/sbin/sshd'
|
||||
SSSCTL = '/usr/sbin/sssctl'
|
||||
LIBARCH = "64"
|
||||
TDBTOOL = '/usr/bin/tdbtool'
|
||||
SECRETS_TDB = '/var/lib/samba/private/secrets.tdb'
|
||||
|
||||
path_namespace = BasePathNamespace
|
||||
def check_paths(self):
|
||||
"""Check paths for missing files
|
||||
|
||||
python3 -c 'from ipaplatform.paths import paths; paths.check_paths()'
|
||||
"""
|
||||
executables = (
|
||||
"/bin", "/sbin", "/usr/bin", "/usr/sbin",
|
||||
self.LIBEXEC_IPA_DIR, self.LIBEXEC_CERTMONGER_DIR
|
||||
)
|
||||
for name in sorted(dir(self)):
|
||||
if not name[0].isupper():
|
||||
continue
|
||||
|
||||
value = getattr(self, name)
|
||||
if not value or not isinstance(value, str):
|
||||
# skip empty values
|
||||
continue
|
||||
if "%" in value or "{" in value:
|
||||
# skip templates
|
||||
continue
|
||||
|
||||
if value.startswith(executables) and value not in executables:
|
||||
if not os.path.isfile(value):
|
||||
print("Missing executable {}={}".format(name, value))
|
||||
|
||||
|
||||
paths = BasePathNamespace()
|
||||
|
||||
Binary file not shown.
@@ -23,56 +23,105 @@ This base module contains default implementations of IPA interface for
|
||||
interacting with system services.
|
||||
'''
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import logging
|
||||
import warnings
|
||||
|
||||
import six
|
||||
|
||||
import ipalib
|
||||
from ipapython import ipautil
|
||||
from ipaplatform.paths import paths
|
||||
from ipalib.plugable import MagicDict
|
||||
from ipaplatform.tasks import tasks
|
||||
|
||||
# pylint: disable=no-name-in-module, import-error
|
||||
if six.PY3:
|
||||
from collections.abc import Mapping
|
||||
else:
|
||||
from collections import Mapping
|
||||
# pylint: enable=no-name-in-module, import-error
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Canonical names of services as IPA wants to see them. As we need to have
|
||||
# *some* naming, set them as in Red Hat distributions. Actual implementation
|
||||
# should make them available through knownservices.<name> and take care of
|
||||
# re-mapping internally, if needed
|
||||
wellknownservices = ['certmonger', 'dirsrv', 'httpd', 'ipa', 'krb5kdc',
|
||||
'messagebus', 'nslcd', 'nscd', 'ntpd', 'portmap',
|
||||
'rpcbind', 'kadmin', 'sshd', 'autofs', 'rpcgssd',
|
||||
'rpcidmapd', 'pki_tomcatd', 'pki_cad', 'chronyd',
|
||||
'domainname']
|
||||
wellknownservices = [
|
||||
'certmonger', 'dirsrv', 'httpd', 'ipa', 'krb5kdc',
|
||||
'dbus', 'nslcd', 'nscd', 'ntpd', 'portmap',
|
||||
'rpcbind', 'kadmin', 'sshd', 'autofs', 'rpcgssd',
|
||||
'rpcidmapd', 'pki_tomcatd', 'chronyd', 'domainname',
|
||||
'named', 'ods_enforcerd', 'ods_signerd', 'gssproxy',
|
||||
'nfs-utils', 'sssd', 'NetworkManager', 'ipa-custodia',
|
||||
'ipa-dnskeysyncd', 'ipa-otpd', 'ipa-ods-exporter',
|
||||
'systemd-resolved',
|
||||
]
|
||||
|
||||
# The common ports for these services. This is used to wait for the
|
||||
# service to become available.
|
||||
wellknownports = {
|
||||
'dirsrv@PKI-IPA.service': [7389],
|
||||
'PKI-IPA': [7389],
|
||||
'dirsrv': [389], # only used if the incoming instance name is blank
|
||||
'pki-cad': [9180, 9443, 9444],
|
||||
'pki-tomcatd@pki-tomcat.service': [8080, 8443],
|
||||
'pki-tomcat': [8080, 8443],
|
||||
'pki-tomcatd': [8080, 8443], # used if the incoming instance name is blank
|
||||
}
|
||||
|
||||
SERVICE_POLL_INTERVAL = 0.1 # seconds
|
||||
|
||||
class KnownServices(MagicDict):
|
||||
|
||||
class KnownServices(Mapping):
|
||||
"""
|
||||
KnownServices is an abstract class factory that should give out instances
|
||||
of well-known platform services. Actual implementation must create these
|
||||
instances as its own attributes on first access (or instance creation)
|
||||
and cache them.
|
||||
"""
|
||||
def __init__(self, d):
|
||||
self.__d = d
|
||||
|
||||
def __getitem__(self, key):
|
||||
return self.__d[key]
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.__d)
|
||||
|
||||
def __len__(self):
|
||||
return len(self.__d)
|
||||
|
||||
def __call__(self):
|
||||
return six.itervalues(self.__d)
|
||||
|
||||
def __getattr__(self, name):
|
||||
try:
|
||||
return self.__d[name]
|
||||
except KeyError:
|
||||
raise AttributeError(name)
|
||||
|
||||
|
||||
class PlatformService(object):
|
||||
class PlatformService:
|
||||
"""
|
||||
PlatformService abstracts out external process running on the system
|
||||
which is possible to administer (start, stop, check status, etc).
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, service_name, api=ipalib.api):
|
||||
def __init__(self, service_name, api=None):
|
||||
# pylint: disable=ipa-forbidden-import
|
||||
import ipalib # FixMe: break import cycle
|
||||
# pylint: enable=ipa-forbidden-import
|
||||
self.service_name = service_name
|
||||
self.api = api
|
||||
if api is not None:
|
||||
self.api = api
|
||||
else:
|
||||
self.api = ipalib.api
|
||||
warnings.warn(
|
||||
"{s.__class__.__name__}('{s.service_name}', api=None) "
|
||||
"is deprecated.".format(s=self),
|
||||
RuntimeWarning, stacklevel=2)
|
||||
|
||||
def start(self, instance_name="", capture_output=True, wait=True,
|
||||
update_service_list=True):
|
||||
@@ -97,8 +146,6 @@ class PlatformService(object):
|
||||
with open(paths.SVC_LIST_FILE, 'w') as f:
|
||||
json.dump(svc_list, f)
|
||||
|
||||
return
|
||||
|
||||
def stop(self, instance_name="", capture_output=True,
|
||||
update_service_list=True):
|
||||
"""
|
||||
@@ -120,12 +167,17 @@ class PlatformService(object):
|
||||
with open(paths.SVC_LIST_FILE, 'w') as f:
|
||||
json.dump(svc_list, f)
|
||||
|
||||
return
|
||||
def reload_or_restart(self, instance_name="", capture_output=True,
|
||||
wait=True):
|
||||
pass
|
||||
|
||||
def restart(self, instance_name="", capture_output=True, wait=True):
|
||||
return
|
||||
pass
|
||||
|
||||
def is_running(self, instance_name=""):
|
||||
def try_restart(self, instance_name="", capture_output=True, wait=True):
|
||||
pass
|
||||
|
||||
def is_running(self, instance_name="", wait=True):
|
||||
return False
|
||||
|
||||
def is_installed(self):
|
||||
@@ -134,29 +186,36 @@ class PlatformService(object):
|
||||
def is_enabled(self, instance_name=""):
|
||||
return False
|
||||
|
||||
def is_masked(self, instance_name=""):
|
||||
return False
|
||||
|
||||
def enable(self, instance_name=""):
|
||||
return
|
||||
pass
|
||||
|
||||
def disable(self, instance_name=""):
|
||||
return
|
||||
pass
|
||||
|
||||
def mask(self, instance_name=""):
|
||||
pass
|
||||
|
||||
def unmask(self, instance_name=""):
|
||||
pass
|
||||
|
||||
def install(self, instance_name=""):
|
||||
return
|
||||
pass
|
||||
|
||||
def remove(self, instance_name=""):
|
||||
return
|
||||
|
||||
def get_config_dir(self, instance_name=""):
|
||||
return
|
||||
pass
|
||||
|
||||
|
||||
class SystemdService(PlatformService):
|
||||
SYSTEMD_SRV_TARGET = "%s.target.wants"
|
||||
|
||||
def __init__(self, service_name, systemd_name, **kwargs):
|
||||
super(SystemdService, self).__init__(service_name, **kwargs)
|
||||
def __init__(self, service_name, systemd_name, api=None):
|
||||
super(SystemdService, self).__init__(service_name, api=api)
|
||||
self.systemd_name = systemd_name
|
||||
self.lib_path = os.path.join(paths.LIB_SYSTEMD_SYSTEMD_DIR, self.systemd_name)
|
||||
self.lib_path = os.path.join(paths.LIB_SYSTEMD_SYSTEMD_DIR,
|
||||
self.systemd_name)
|
||||
self.lib_path_exists = None
|
||||
|
||||
def service_instance(self, instance_name, operation=None):
|
||||
@@ -166,8 +225,7 @@ class SystemdService(PlatformService):
|
||||
elements = self.systemd_name.split("@")
|
||||
|
||||
# Make sure the correct DS instance is returned
|
||||
if (elements[0] == 'dirsrv' and not instance_name and
|
||||
operation == 'is-active'):
|
||||
if elements[0] == 'dirsrv' and not instance_name:
|
||||
|
||||
return ('dirsrv@%s.service'
|
||||
% str(self.api.env.realm.replace('.', '-')))
|
||||
@@ -238,73 +296,91 @@ class SystemdService(PlatformService):
|
||||
if instance == "ipa-otpd.socket":
|
||||
args.append("--ignore-dependencies")
|
||||
|
||||
ipautil.run(args, capture_output=capture_output)
|
||||
ipautil.run(args, skip_output=not capture_output)
|
||||
|
||||
if getattr(self.api.env, 'context', None) in ['ipactl', 'installer']:
|
||||
update_service_list = True
|
||||
else:
|
||||
update_service_list = False
|
||||
update_service_list = getattr(self.api.env, 'context',
|
||||
None) in ['ipactl', 'installer']
|
||||
super(SystemdService, self).stop(
|
||||
instance_name,
|
||||
update_service_list=update_service_list)
|
||||
logger.debug('Stop of %s complete', instance)
|
||||
|
||||
def start(self, instance_name="", capture_output=True, wait=True):
|
||||
ipautil.run([paths.SYSTEMCTL, "start",
|
||||
self.service_instance(instance_name)],
|
||||
capture_output=capture_output)
|
||||
skip_output=not capture_output)
|
||||
|
||||
if getattr(self.api.env, 'context', None) in ['ipactl', 'installer']:
|
||||
update_service_list = True
|
||||
else:
|
||||
update_service_list = False
|
||||
update_service_list = getattr(self.api.env, 'context',
|
||||
None) in ['ipactl', 'installer']
|
||||
|
||||
if wait and self.is_running(instance_name):
|
||||
self.wait_for_open_ports(self.service_instance(instance_name))
|
||||
super(SystemdService, self).start(
|
||||
instance_name,
|
||||
update_service_list=update_service_list)
|
||||
logger.debug('Start of %s complete',
|
||||
self.service_instance(instance_name))
|
||||
|
||||
def restart(self, instance_name="", capture_output=True, wait=True):
|
||||
ipautil.run([paths.SYSTEMCTL, "restart",
|
||||
self.service_instance(instance_name)],
|
||||
capture_output=capture_output)
|
||||
def _restart_base(self, instance_name, operation, capture_output=True,
|
||||
wait=False):
|
||||
|
||||
ipautil.run([paths.SYSTEMCTL, operation,
|
||||
self.service_instance(instance_name)],
|
||||
skip_output=not capture_output)
|
||||
|
||||
if wait and self.is_running(instance_name):
|
||||
self.wait_for_open_ports(self.service_instance(instance_name))
|
||||
logger.debug('Restart of %s complete',
|
||||
self.service_instance(instance_name))
|
||||
|
||||
def is_running(self, instance_name=""):
|
||||
def reload_or_restart(self, instance_name="", capture_output=True,
|
||||
wait=True):
|
||||
self._restart_base(instance_name, "reload-or-restart",
|
||||
capture_output, wait)
|
||||
|
||||
def restart(self, instance_name="", capture_output=True, wait=True):
|
||||
self._restart_base(instance_name, "restart",
|
||||
capture_output, wait)
|
||||
|
||||
def try_restart(self, instance_name="", capture_output=True, wait=True):
|
||||
self._restart_base(instance_name, "try-restart",
|
||||
capture_output, wait)
|
||||
|
||||
def is_running(self, instance_name="", wait=True):
|
||||
instance = self.service_instance(instance_name, 'is-active')
|
||||
|
||||
while True:
|
||||
try:
|
||||
(sout, serr, rcode) = ipautil.run(
|
||||
result = ipautil.run(
|
||||
[paths.SYSTEMCTL, "is-active", instance],
|
||||
capture_output=True
|
||||
)
|
||||
except ipautil.CalledProcessError as e:
|
||||
if e.returncode == 3 and 'activating' in str(e.output):
|
||||
time.sleep(SERVICE_POLL_INTERVAL)
|
||||
continue
|
||||
return False
|
||||
else:
|
||||
# activating
|
||||
if rcode == 3 and 'activating' in str(sout):
|
||||
if result.returncode == 3 and 'activating' in result.output:
|
||||
time.sleep(SERVICE_POLL_INTERVAL)
|
||||
continue
|
||||
# active
|
||||
if rcode == 0:
|
||||
if result.returncode == 0:
|
||||
return True
|
||||
# not active
|
||||
return False
|
||||
|
||||
def is_installed(self):
|
||||
try:
|
||||
(sout, serr, rcode) = ipautil.run([paths.SYSTEMCTL,
|
||||
"list-unit-files",
|
||||
"--full"])
|
||||
if rcode != 0:
|
||||
result = ipautil.run(
|
||||
[paths.SYSTEMCTL, "list-unit-files", "--full"],
|
||||
capture_output=True)
|
||||
if result.returncode != 0:
|
||||
return False
|
||||
else:
|
||||
svar = self.parse_variables(sout)
|
||||
if not self.service_instance("") in svar:
|
||||
svar = self.parse_variables(result.output)
|
||||
if self.service_instance("") not in svar:
|
||||
# systemd doesn't show the service
|
||||
return False
|
||||
except ipautil.CalledProcessError:
|
||||
@@ -315,18 +391,32 @@ class SystemdService(PlatformService):
|
||||
def is_enabled(self, instance_name=""):
|
||||
enabled = True
|
||||
try:
|
||||
(sout, serr, rcode) = ipautil.run(
|
||||
[paths.SYSTEMCTL,
|
||||
"is-enabled",
|
||||
self.service_instance(instance_name)])
|
||||
result = ipautil.run(
|
||||
[paths.SYSTEMCTL, "is-enabled",
|
||||
self.service_instance(instance_name)])
|
||||
|
||||
if rcode != 0:
|
||||
if result.returncode != 0:
|
||||
enabled = False
|
||||
|
||||
except ipautil.CalledProcessError:
|
||||
enabled = False
|
||||
return enabled
|
||||
|
||||
def is_masked(self, instance_name=""):
|
||||
masked = False
|
||||
try:
|
||||
result = ipautil.run(
|
||||
[paths.SYSTEMCTL, "is-enabled",
|
||||
self.service_instance(instance_name)],
|
||||
capture_output=True)
|
||||
|
||||
if result.returncode == 1 and result.output == 'masked':
|
||||
masked = True
|
||||
|
||||
except ipautil.CalledProcessError:
|
||||
pass
|
||||
return masked
|
||||
|
||||
def enable(self, instance_name=""):
|
||||
if self.lib_path_exists is None:
|
||||
self.lib_path_exists = os.path.exists(self.lib_path)
|
||||
@@ -359,8 +449,9 @@ class SystemdService(PlatformService):
|
||||
self.service_instance(instance_name))
|
||||
|
||||
try:
|
||||
if not ipautil.dir_exists(srv_tgt):
|
||||
if not os.path.isdir(srv_tgt):
|
||||
os.mkdir(srv_tgt)
|
||||
os.chmod(srv_tgt, 0o755)
|
||||
if os.path.exists(srv_lnk):
|
||||
# Remove old link
|
||||
os.unlink(srv_lnk)
|
||||
@@ -373,8 +464,8 @@ class SystemdService(PlatformService):
|
||||
# Link exists and it is broken, make new one
|
||||
os.unlink(srv_lnk)
|
||||
os.symlink(self.lib_path, srv_lnk)
|
||||
ipautil.run([paths.SYSTEMCTL, "--system", "daemon-reload"])
|
||||
except:
|
||||
tasks.systemd_daemon_reload()
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
self.__enable(instance_name)
|
||||
@@ -393,25 +484,39 @@ class SystemdService(PlatformService):
|
||||
self.service_instance(instance_name))
|
||||
|
||||
try:
|
||||
if ipautil.dir_exists(srv_tgt):
|
||||
if os.path.isdir(srv_tgt):
|
||||
if os.path.islink(srv_lnk):
|
||||
os.unlink(srv_lnk)
|
||||
ipautil.run([paths.SYSTEMCTL, "--system", "daemon-reload"])
|
||||
except:
|
||||
tasks.systemd_daemon_reload()
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
self.__disable(instance_name)
|
||||
try:
|
||||
ipautil.run([paths.SYSTEMCTL, "disable",
|
||||
self.service_instance(instance_name)])
|
||||
except ipautil.CalledProcessError:
|
||||
pass
|
||||
|
||||
def __enable(self, instance_name=""):
|
||||
def mask(self, instance_name=""):
|
||||
srv_tgt = os.path.join(paths.ETC_SYSTEMD_SYSTEM_DIR, self.service_instance(instance_name))
|
||||
if os.path.exists(srv_tgt):
|
||||
os.unlink(srv_tgt)
|
||||
try:
|
||||
ipautil.run([paths.SYSTEMCTL, "enable",
|
||||
ipautil.run([paths.SYSTEMCTL, "mask",
|
||||
self.service_instance(instance_name)])
|
||||
except ipautil.CalledProcessError:
|
||||
pass
|
||||
|
||||
def __disable(self, instance_name=""):
|
||||
def unmask(self, instance_name=""):
|
||||
try:
|
||||
ipautil.run([paths.SYSTEMCTL, "disable",
|
||||
ipautil.run([paths.SYSTEMCTL, "unmask",
|
||||
self.service_instance(instance_name)])
|
||||
except ipautil.CalledProcessError:
|
||||
pass
|
||||
|
||||
def __enable(self, instance_name=""):
|
||||
try:
|
||||
ipautil.run([paths.SYSTEMCTL, "enable",
|
||||
self.service_instance(instance_name)])
|
||||
except ipautil.CalledProcessError:
|
||||
pass
|
||||
@@ -425,9 +530,13 @@ class SystemdService(PlatformService):
|
||||
|
||||
# Objects below are expected to be exported by platform module
|
||||
|
||||
service = None
|
||||
knownservices = None
|
||||
def base_service_class_factory(name, api=None):
|
||||
raise NotImplementedError
|
||||
|
||||
# System may support more time&date services. FreeIPA supports ntpd only, other
|
||||
# services will be disabled during IPA installation
|
||||
|
||||
service = base_service_class_factory
|
||||
knownservices = KnownServices({})
|
||||
|
||||
# System may support more time&date services. FreeIPA supports chrony only.
|
||||
# Other services will be disabled during IPA installation
|
||||
timedate_services = ['ntpd', 'chronyd']
|
||||
|
||||
Binary file not shown.
@@ -22,52 +22,115 @@
|
||||
This module contains default platform-specific implementations of system tasks.
|
||||
'''
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import logging
|
||||
import textwrap
|
||||
|
||||
from pkg_resources import parse_version
|
||||
|
||||
from ipaplatform.paths import paths
|
||||
from ipapython import ipautil
|
||||
from ipapython.ipachangeconf import IPAChangeConf
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class BaseTaskNamespace(object):
|
||||
# TODO: Add other masters as FallbackDNS ?
|
||||
RESOLVE1_IPA_CONF = textwrap.dedent("""
|
||||
# auto-generated by IPA installer
|
||||
[Resolve]
|
||||
# use local BIND instance
|
||||
DNS=127.0.0.1
|
||||
# make local BIND default DNS server, add search suffixes
|
||||
Domains=~. {searchdomains}
|
||||
""")
|
||||
|
||||
def restore_context(self, filepath):
|
||||
"""
|
||||
Restore SELinux security context on the given filepath.
|
||||
|
||||
class BaseTaskNamespace:
|
||||
|
||||
def restore_context(self, filepath, force=False):
|
||||
"""Restore SELinux security context on the given filepath.
|
||||
|
||||
No return value expected.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
return
|
||||
|
||||
def backup_and_replace_hostname(self, fstore, statestore, hostname):
|
||||
def backup_hostname(self, fstore, statestore):
|
||||
"""
|
||||
Backs up the current hostname in the statestore (so that it can be
|
||||
restored by the restore_network_configuration platform task).
|
||||
|
||||
Makes sure that new hostname (passed via hostname argument) is set
|
||||
as a new pemanent hostname for this host.
|
||||
restored by the restore_hostname platform task).
|
||||
|
||||
No return value expected.
|
||||
"""
|
||||
|
||||
return
|
||||
raise NotImplementedError()
|
||||
|
||||
def insert_ca_cert_into_systemwide_ca_store(self, path):
|
||||
def reload_systemwide_ca_store(self):
|
||||
"""
|
||||
Adds the CA certificate located at 'path' to the systemwide CA store
|
||||
Reloads the systemwide CA store.
|
||||
|
||||
Returns True if the operation succeeded, False otherwise.
|
||||
"""
|
||||
|
||||
raise NotImplementedError()
|
||||
|
||||
def insert_ca_certs_into_systemwide_ca_store(self, ca_certs):
|
||||
"""
|
||||
Adds CA certificates from 'ca_certs' to the systemwide CA store
|
||||
(if available on the platform).
|
||||
|
||||
Returns True if the operation succeeded, False otherwise.
|
||||
"""
|
||||
|
||||
return True
|
||||
try:
|
||||
if self.platform_insert_ca_certs(ca_certs):
|
||||
return self.reload_systemwide_ca_store()
|
||||
except Exception:
|
||||
logger.exception('Could not populate systemwide CA store')
|
||||
|
||||
def remove_ca_cert_from_systemwide_ca_store(self, path):
|
||||
return False
|
||||
|
||||
def platform_insert_ca_certs(self, ca_certs):
|
||||
"""
|
||||
Removes the CA certificate located at 'path' from the systemwide CA
|
||||
store (if available on the platform).
|
||||
Platform implementations override this method to implement
|
||||
population of the systemwide CA store.
|
||||
|
||||
Returns True if changes were made to the CA store, False otherwise.
|
||||
|
||||
Raises Exception if something went wrong.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def remove_ca_certs_from_systemwide_ca_store(self):
|
||||
"""
|
||||
Removes IPA CA certificates from the systemwide CA store
|
||||
(if available on the platform).
|
||||
|
||||
Returns True if the operation succeeded, False otherwise.
|
||||
"""
|
||||
|
||||
return True
|
||||
try:
|
||||
if self.platform_remove_ca_certs():
|
||||
return self.reload_systemwide_ca_store()
|
||||
except Exception:
|
||||
logger.exception(
|
||||
'Could not remove certificates from systemwide CA store'
|
||||
)
|
||||
|
||||
return False
|
||||
|
||||
def platform_remove_ca_certs(self):
|
||||
"""
|
||||
Platform implementations override this method to implement
|
||||
removal of certificates from the systemwide CA store.
|
||||
|
||||
Returns True if changes were made to the CA store, False otherwise.
|
||||
|
||||
Raises Exception if something went wrong.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def get_svc_list_file(self):
|
||||
"""
|
||||
@@ -76,25 +139,46 @@ class BaseTaskNamespace(object):
|
||||
|
||||
return paths.SVC_LIST_FILE
|
||||
|
||||
def check_selinux_status(self):
|
||||
def is_selinux_enabled(self):
|
||||
"""Check if SELinux is available and enabled
|
||||
|
||||
:return: True if SELinux is available and enabled
|
||||
"""
|
||||
Checks if SELinux is available on the platform. If it is, this task
|
||||
also makes sure that restorecon tool is available.
|
||||
return False
|
||||
|
||||
def check_selinux_status(self):
|
||||
"""Checks if SELinux is available on the platform.
|
||||
|
||||
If it is, this task also makes sure that restorecon tool is available.
|
||||
|
||||
If SELinux is available, but restorcon tool is not installed, raises
|
||||
an RuntimeError, which suggest installing the package containing
|
||||
restorecon and rerunning the installation.
|
||||
|
||||
:return: True if SELinux is available and enabled
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
return
|
||||
def check_ipv6_stack_enabled(self):
|
||||
"""Check whether IPv6 kernel module is loaded"""
|
||||
|
||||
def restore_network_configuration(self, fstore, statestore):
|
||||
raise NotImplementedError()
|
||||
|
||||
def detect_container(self):
|
||||
"""Check if running inside a container
|
||||
|
||||
:returns: container runtime or None
|
||||
:rtype: str, None
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def restore_hostname(self, fstore, statestore):
|
||||
"""
|
||||
Restores the original hostname as backed up in the
|
||||
backup_and_replace_hostname platform task.
|
||||
backup_hostname platform task.
|
||||
"""
|
||||
|
||||
return
|
||||
raise NotImplementedError()
|
||||
|
||||
def restore_pre_ipa_client_configuration(self, fstore, statestore,
|
||||
was_sssd_installed,
|
||||
@@ -106,30 +190,353 @@ class BaseTaskNamespace(object):
|
||||
modify_pam_to_use_krb5
|
||||
"""
|
||||
|
||||
return
|
||||
raise NotImplementedError()
|
||||
|
||||
def set_nisdomain(self, nisdomain):
|
||||
"""
|
||||
Sets the NIS domain name to 'nisdomain'.
|
||||
"""
|
||||
|
||||
return
|
||||
raise NotImplementedError()
|
||||
|
||||
def modify_nsswitch_pam_stack(self, sssd, mkhomedir, statestore):
|
||||
def modify_nsswitch_pam_stack(self, sssd, mkhomedir, statestore,
|
||||
sudo=True):
|
||||
"""
|
||||
If sssd flag is true, configure pam and nsswtich so that SSSD is used
|
||||
If sssd flag is true, configure pam and nsswitch so that SSSD is used
|
||||
for retrieving user information and authentication.
|
||||
|
||||
Otherwise, configure pam and nsswitch to leverage pure LDAP.
|
||||
"""
|
||||
|
||||
return
|
||||
raise NotImplementedError()
|
||||
|
||||
def modify_pam_to_use_krb5(self, statestore):
|
||||
"""
|
||||
Configure pam stack to allow kerberos authentication.
|
||||
"""
|
||||
|
||||
return
|
||||
raise NotImplementedError()
|
||||
|
||||
task_namespace = BaseTaskNamespace()
|
||||
def is_nosssd_supported(self):
|
||||
"""
|
||||
Check if the flag --no-sssd is supported for client install.
|
||||
"""
|
||||
return True
|
||||
|
||||
def is_mkhomedir_supported(self):
|
||||
"""
|
||||
Check if the flag --mkhomedir is supported for client install.
|
||||
"""
|
||||
return True
|
||||
|
||||
def backup_auth_configuration(self, path):
|
||||
"""
|
||||
Create backup of access control configuration.
|
||||
:param path: store the backup here. This will be passed to
|
||||
restore_auth_configuration as well.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def restore_auth_configuration(self, path):
|
||||
"""
|
||||
Restore backup of access control configuration.
|
||||
:param path: restore the backup from here.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def migrate_auth_configuration(self, statestore):
|
||||
"""
|
||||
Migrate pam stack configuration to authselect.
|
||||
"""
|
||||
|
||||
def set_selinux_booleans(self, required_settings, backup_func=None):
|
||||
"""Set the specified SELinux booleans
|
||||
|
||||
:param required_settings: A dictionary mapping the boolean names
|
||||
to desired_values.
|
||||
The desired value can be 'on' or 'off',
|
||||
or None to leave the setting unchanged.
|
||||
|
||||
:param backup_func: A function called for each boolean with two
|
||||
arguments: the name and the previous value
|
||||
|
||||
If SELinux is disabled, return False; on success returns True.
|
||||
|
||||
If setting the booleans fails,
|
||||
an ipapython.errors.SetseboolError is raised.
|
||||
"""
|
||||
|
||||
raise NotImplementedError()
|
||||
|
||||
@staticmethod
|
||||
def parse_ipa_version(version):
|
||||
"""
|
||||
:param version: textual version
|
||||
:return: object implementing proper __cmp__ method for version compare
|
||||
"""
|
||||
return parse_version(version)
|
||||
|
||||
def set_hostname(self, hostname):
|
||||
"""
|
||||
Set hostname for the system
|
||||
|
||||
No return value expected, raise CalledProcessError when error occurred
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def configure_httpd_service_ipa_conf(self):
|
||||
"""Configure httpd service to work with IPA"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def configure_http_gssproxy_conf(self, ipauser):
|
||||
raise NotImplementedError()
|
||||
|
||||
def remove_httpd_service_ipa_conf(self):
|
||||
"""Remove configuration of httpd service of IPA"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def configure_httpd_wsgi_conf(self):
|
||||
"""Configure WSGI for correct Python version"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def configure_httpd_protocol(self):
|
||||
"""Configure TLS protocols in Apache"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def is_fips_enabled(self):
|
||||
return False
|
||||
|
||||
def add_user_to_group(self, user, group):
|
||||
logger.debug('Adding user %s to group %s', user, group)
|
||||
args = [paths.USERMOD, '-a', '-G', group, user]
|
||||
try:
|
||||
ipautil.run(args)
|
||||
logger.debug('Done adding user to group')
|
||||
except ipautil.CalledProcessError as e:
|
||||
logger.debug('Failed to add user to group: %s', e)
|
||||
|
||||
def setup_httpd_logging(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
def systemd_daemon_reload(self):
|
||||
"""Tell systemd to reload config files"""
|
||||
raise NotImplementedError
|
||||
|
||||
def configure_dns_resolver(self, nameservers, searchdomains, *,
|
||||
resolve1_enabled=False, fstore=None):
|
||||
"""Configure global DNS resolver (e.g. /etc/resolv.conf)
|
||||
|
||||
:param nameservers: list of IP addresses
|
||||
:param searchdomains: list of search domaons
|
||||
:param resolve1_enabled: is systemd-resolved enabled?
|
||||
:param fstore: optional file store for backup
|
||||
"""
|
||||
if resolve1_enabled:
|
||||
# break circular import
|
||||
from ipaplatform.services import knownservices
|
||||
|
||||
confd = os.path.dirname(paths.SYSTEMD_RESOLVED_IPA_CONF)
|
||||
os.makedirs(confd, exist_ok=True)
|
||||
|
||||
cfg = RESOLVE1_IPA_CONF.format(
|
||||
searchdomains=" ".join(searchdomains)
|
||||
)
|
||||
with open(paths.SYSTEMD_RESOLVED_IPA_CONF, "w") as f:
|
||||
os.fchmod(f.fileno(), 0o644)
|
||||
f.write(cfg)
|
||||
|
||||
knownservices["systemd-resolved"].reload_or_restart()
|
||||
|
||||
def unconfigure_dns_resolver(self, fstore=None):
|
||||
"""Unconfigure global DNS resolver (e.g. /etc/resolv.conf)
|
||||
|
||||
:param fstore: optional file store for restore
|
||||
"""
|
||||
if fstore is not None and fstore.has_file(paths.RESOLV_CONF):
|
||||
fstore.restore_file(paths.RESOLV_CONF)
|
||||
|
||||
if os.path.isfile(paths.SYSTEMD_RESOLVED_IPA_CONF):
|
||||
# break circular import
|
||||
from ipaplatform.services import knownservices
|
||||
|
||||
os.unlink(paths.SYSTEMD_RESOLVED_IPA_CONF)
|
||||
knownservices["systemd-resolved"].reload_or_restart()
|
||||
|
||||
def configure_pkcs11_modules(self, fstore):
|
||||
"""Disable p11-kit modules
|
||||
|
||||
The p11-kit configuration injects p11-kit-proxy into all NSS
|
||||
databases. Amongst other p11-kit loads SoftHSM2 PKCS#11 provider.
|
||||
This interferes with 389-DS, certmonger, Dogtag and other services.
|
||||
For example certmonger tries to open OpenDNSSEC's SoftHSM2 token,
|
||||
although it doesn't use it at all. It also breaks Dogtag HSM support
|
||||
testing with SoftHSM2.
|
||||
|
||||
IPA server does neither need nor use SoftHSM2 proxied by p11-kit.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def restore_pkcs11_modules(self, fstore):
|
||||
"""Restore global p11-kit modules for NSS
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def get_pkcs11_modules(self):
|
||||
"""Return the list of module config files setup by IPA.
|
||||
"""
|
||||
return ()
|
||||
|
||||
def configure_nsswitch_database(self, fstore, database, services,
|
||||
preserve=True, append=True,
|
||||
default_value=()):
|
||||
"""
|
||||
Edits the specified nsswitch.conf database (e.g. passwd, group,
|
||||
sudoers) to use the specified service(s).
|
||||
|
||||
Arguments:
|
||||
fstore - FileStore to backup the nsswitch.conf
|
||||
database - database configuration that should be ammended,
|
||||
e.g. 'sudoers'
|
||||
service - list of services that should be added, e.g. ['sss']
|
||||
preserve - if True, the already configured services will be
|
||||
preserved
|
||||
|
||||
The next arguments modify the behaviour if preserve=True:
|
||||
append - if True, the services will be appended, if False,
|
||||
prepended
|
||||
default_value - list of services that are considered as default (if
|
||||
the database is not mentioned in nsswitch.conf),
|
||||
e.g. ['files']
|
||||
"""
|
||||
|
||||
# Backup the original version of nsswitch.conf, we're going to edit it
|
||||
# now
|
||||
if not fstore.has_file(paths.NSSWITCH_CONF):
|
||||
fstore.backup_file(paths.NSSWITCH_CONF)
|
||||
|
||||
conf = IPAChangeConf("IPA Installer")
|
||||
conf.setOptionAssignment(':')
|
||||
|
||||
if preserve:
|
||||
# Read the existing configuration
|
||||
with open(paths.NSSWITCH_CONF, 'r') as f:
|
||||
opts = conf.parse(f)
|
||||
raw_database_entry = conf.findOpts(opts, 'option', database)[1]
|
||||
|
||||
# Detect the list of already configured services
|
||||
if not raw_database_entry:
|
||||
# If there is no database entry, database is not present in
|
||||
# the nsswitch.conf. Set the list of services to the
|
||||
# default list, if passed.
|
||||
configured_services = list(default_value)
|
||||
else:
|
||||
configured_services = raw_database_entry[
|
||||
'value'].strip().split()
|
||||
|
||||
# Make sure no service is added if already mentioned in the list
|
||||
added_services = [s for s in services
|
||||
if s not in configured_services]
|
||||
|
||||
# Prepend / append the list of new services
|
||||
if append:
|
||||
new_value = ' ' + ' '.join(configured_services +
|
||||
added_services)
|
||||
else:
|
||||
new_value = ' ' + ' '.join(added_services +
|
||||
configured_services)
|
||||
|
||||
else:
|
||||
# Preserve not set, let's rewrite existing configuration
|
||||
new_value = ' ' + ' '.join(services)
|
||||
|
||||
# Set new services as sources for database
|
||||
opts = [
|
||||
conf.setOption(database, new_value),
|
||||
conf.emptyLine(),
|
||||
]
|
||||
|
||||
conf.changeConf(paths.NSSWITCH_CONF, opts)
|
||||
logger.info("Configured %s in %s", database, paths.NSSWITCH_CONF)
|
||||
|
||||
def enable_sssd_sudo(self, fstore):
|
||||
"""Configure nsswitch.conf to use sssd for sudo"""
|
||||
self.configure_nsswitch_database(
|
||||
fstore, 'sudoers', ['sss'],
|
||||
default_value=['files'])
|
||||
|
||||
def enable_ldap_automount(self, statestore):
|
||||
"""
|
||||
Point automount to ldap in nsswitch.conf.
|
||||
This function is for non-SSSD setups only.
|
||||
"""
|
||||
conf = IPAChangeConf("IPA Installer")
|
||||
conf.setOptionAssignment(':')
|
||||
|
||||
with open(paths.NSSWITCH_CONF, 'r') as f:
|
||||
current_opts = conf.parse(f)
|
||||
current_nss_value = conf.findOpts(
|
||||
current_opts, name='automount', type='option'
|
||||
)[1]
|
||||
if current_nss_value is None:
|
||||
# no automount database present
|
||||
current_nss_value = False # None cannot be backed up
|
||||
else:
|
||||
current_nss_value = current_nss_value['value']
|
||||
statestore.backup_state(
|
||||
'ipa-client-automount-nsswitch', 'previous-automount',
|
||||
current_nss_value
|
||||
)
|
||||
|
||||
nss_value = ' files ldap'
|
||||
opts = [
|
||||
{
|
||||
'name': 'automount',
|
||||
'type': 'option',
|
||||
'action': 'set',
|
||||
'value': nss_value,
|
||||
},
|
||||
{'name': 'empty', 'type': 'empty'},
|
||||
]
|
||||
conf.changeConf(paths.NSSWITCH_CONF, opts)
|
||||
|
||||
logger.info("Configured %s", paths.NSSWITCH_CONF)
|
||||
|
||||
def disable_ldap_automount(self, statestore):
|
||||
"""Disable automount using LDAP"""
|
||||
if statestore.get_state(
|
||||
'ipa-client-automount-nsswitch', 'previous-automount'
|
||||
) is False:
|
||||
# Previous nsswitch.conf had no automount database configured
|
||||
# so remove it.
|
||||
conf = IPAChangeConf("IPA automount installer")
|
||||
conf.setOptionAssignment(':')
|
||||
changes = [conf.rmOption('automount')]
|
||||
conf.changeConf(paths.NSSWITCH_CONF, changes)
|
||||
self.restore_context(paths.NSSWITCH_CONF)
|
||||
statestore.delete_state(
|
||||
'ipa-client-automount-nsswitch', 'previous-automount'
|
||||
)
|
||||
elif statestore.get_state(
|
||||
'ipa-client-automount-nsswitch', 'previous-automount'
|
||||
) is not None:
|
||||
nss_value = statestore.get_state(
|
||||
'ipa-client-automount-nsswitch', 'previous-automount'
|
||||
)
|
||||
opts = [
|
||||
{
|
||||
'name': 'automount',
|
||||
'type': 'option',
|
||||
'action': 'set',
|
||||
'value': nss_value,
|
||||
},
|
||||
{'name': 'empty', 'type': 'empty'},
|
||||
]
|
||||
conf = IPAChangeConf("IPA automount installer")
|
||||
conf.setOptionAssignment(':')
|
||||
conf.changeConf(paths.NSSWITCH_CONF, opts)
|
||||
self.restore_context(paths.NSSWITCH_CONF)
|
||||
statestore.delete_state(
|
||||
'ipa-client-automount-nsswitch', 'previous-automount'
|
||||
)
|
||||
|
||||
tasks = BaseTaskNamespace()
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user