summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-02-19 23:09:03 -0500
committerRob Crittenden <rcritten@redhat.com>2011-02-21 11:21:23 -0500
commit2f82112bb3fdb02801fb1cb71c169dc77786cf39 (patch)
tree03b8786b987b45777713259f799063e4a72921f8 /ipalib/plugins/baseldap.py
parent18be4ebec317ad3e4d3b5684f506cadba8cdb837 (diff)
downloadfreeipa-2f82112bb3fdb02801fb1cb71c169dc77786cf39.tar.gz
freeipa-2f82112bb3fdb02801fb1cb71c169dc77786cf39.tar.xz
freeipa-2f82112bb3fdb02801fb1cb71c169dc77786cf39.zip
Add handling for indirect memberof other entries.
This creates a new custom attribute, memberofindirect_[plugin]. Using this you can tell the difference between being an actual memberof another entry and being a memberof as the result if inheritence. This is particularly useful when trying to remove members of an entry, you can only remove direct members. I had to add a couple of short sleep calls to make things work a little better. The memberof plugin runs as a postop and we have no way of knowing when it has done its work. If we don't pause we may show some stale data that memberof hasn't updated yet. .3 seconds is an arbitrary choice. ticket 966
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 2e284274b..3cb72d7b0 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -50,6 +50,9 @@ global_output_params = (
Str('member_host?',
label=_('Member hosts'),
),
+ Str('member_hostgroup?',
+ label=_('Member host-groups'),
+ ),
Str('memberof_hostgroup?',
label=_('Member of host-groups'),
),
@@ -128,6 +131,18 @@ global_output_params = (
Str('memberindirect_sudocmd?',
label='Indirect Member SUDO commands',
),
+ Str('memberofindirect_group?',
+ label='Indirect Member of group',
+ ),
+ Str('memberofindirect_netgroup?',
+ label='Indirect Member of netgroup',
+ ),
+ Str('memberofindirect_hostgroup?',
+ label='Indirect Member of host-group',
+ ),
+ Str('memberofindirect_role?',
+ label='Indirect Member of role',
+ ),
Str('externalhost?',
label=_('External host'),
),
@@ -1184,6 +1199,9 @@ class LDAPRemoveMember(LDAPModMember):
set(self.obj.default_attributes + member_dns.keys())
)
+ # Give memberOf a chance to update entries
+ time.sleep(.3)
+
try:
(dn, entry_attrs) = ldap.get_entry(
dn, attrs_list, normalize=self.obj.normalize_dn