mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipa_restore: Restore SELinux context of template_dir /var/log/dirsrv/slapd-X
The template directory /var/log/dirsrv/slapd-X could be created with the wrong SELinux context. Related to: https://pagure.io/freeipa/issue/7662 Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
@@ -607,10 +607,13 @@ class Restore(admintool.AdminTool):
|
||||
logger.info("Waiting for LDIF to finish")
|
||||
wait_for_task(conn, dn)
|
||||
else:
|
||||
template_dir = paths.VAR_LOG_DIRSRV_INSTANCE_TEMPLATE % instance
|
||||
try:
|
||||
os.makedirs(paths.VAR_LOG_DIRSRV_INSTANCE_TEMPLATE % instance)
|
||||
os.makedirs(template_dir)
|
||||
except OSError as e:
|
||||
pass
|
||||
# Restore SELinux context of template_dir
|
||||
tasks.restore_context(template_dir)
|
||||
|
||||
args = [paths.LDIF2DB,
|
||||
'-Z', instance,
|
||||
|
||||
Reference in New Issue
Block a user