mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
dns: fix privileges' memberof during dns install
Permissions with member attrs pointing to privileges are created before the privileges. Run memberof plugin task to fix other ends of the relationships. https://fedorahosted.org/freeipa/ticket/4637 Reviewed-By: Martin Kosek <mkosek@redhat.com>
This commit is contained in:
parent
889bf4ac7a
commit
5c9aec3605
@ -22,6 +22,7 @@ import os
|
|||||||
import pwd
|
import pwd
|
||||||
import netaddr
|
import netaddr
|
||||||
import re
|
import re
|
||||||
|
import time
|
||||||
|
|
||||||
import ldap
|
import ldap
|
||||||
|
|
||||||
@ -628,6 +629,35 @@ class BindInstance(service.Service):
|
|||||||
|
|
||||||
def __setup_dns_container(self):
|
def __setup_dns_container(self):
|
||||||
self._ldap_mod("dns.ldif", self.sub_dict)
|
self._ldap_mod("dns.ldif", self.sub_dict)
|
||||||
|
self.__fix_dns_privilege_members()
|
||||||
|
|
||||||
|
def __fix_dns_privilege_members(self):
|
||||||
|
ldap = api.Backend.ldap2
|
||||||
|
|
||||||
|
cn = 'Update PBAC memberOf %s' % time.time()
|
||||||
|
task_dn = DN(('cn', cn), ('cn', 'memberof task'), ('cn', 'tasks'),
|
||||||
|
('cn', 'config'))
|
||||||
|
basedn = DN(api.env.container_privilege, api.env.basedn)
|
||||||
|
entry = ldap.make_entry(
|
||||||
|
task_dn,
|
||||||
|
objectclass=['top', 'extensibleObject'],
|
||||||
|
cn=[cn],
|
||||||
|
basedn=[basedn],
|
||||||
|
filter=['(objectclass=*)'],
|
||||||
|
ttl=[10])
|
||||||
|
ldap.add_entry(entry)
|
||||||
|
|
||||||
|
start_time = time.time()
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
task = ldap.get_entry(task_dn)
|
||||||
|
except errors.NotFound:
|
||||||
|
break
|
||||||
|
if 'nstaskexitcode' in task:
|
||||||
|
break
|
||||||
|
time.sleep(1)
|
||||||
|
if time.time() > (start_time + 60):
|
||||||
|
raise errors.TaskTimeout(task='memberof', task_dn=task_dn)
|
||||||
|
|
||||||
def __setup_zone(self):
|
def __setup_zone(self):
|
||||||
nameserver_ip_address = self.ip_address
|
nameserver_ip_address = self.ip_address
|
||||||
|
Loading…
Reference in New Issue
Block a user