mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-28 09:06:44 -06:00
fix broken search for users by their manager
The patch fixes incorrect construction of search filter when using `ipa user-find` with '--manager' option. https://fedorahosted.org/freeipa/ticket/5146 Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
parent
cf59981cc2
commit
7ceaa8e26c
@ -561,6 +561,14 @@ class baseuser_find(LDAPSearch):
|
|||||||
"""
|
"""
|
||||||
Prototype command plugin to be implemented by real plugin
|
Prototype command plugin to be implemented by real plugin
|
||||||
"""
|
"""
|
||||||
|
def args_options_2_entry(self, *args, **options):
|
||||||
|
newoptions = {}
|
||||||
|
self.common_enhance_options(newoptions, **options)
|
||||||
|
options.update(newoptions)
|
||||||
|
|
||||||
|
return super(baseuser_find, self).args_options_2_entry(
|
||||||
|
*args, **options)
|
||||||
|
|
||||||
def common_enhance_options(self, newoptions, **options):
|
def common_enhance_options(self, newoptions, **options):
|
||||||
# assure the manager attr is a dn, not just a bare uid
|
# assure the manager attr is a dn, not just a bare uid
|
||||||
manager = options.get('manager')
|
manager = options.get('manager')
|
||||||
|
@ -449,13 +449,6 @@ class stageuser_find(baseuser_find):
|
|||||||
member_attributes = ['memberof']
|
member_attributes = ['memberof']
|
||||||
has_output_params = baseuser_find.has_output_params + stageuser_output_params
|
has_output_params = baseuser_find.has_output_params + stageuser_output_params
|
||||||
|
|
||||||
def execute(self, *args, **options):
|
|
||||||
newoptions = {}
|
|
||||||
self.common_enhance_options(newoptions, **options)
|
|
||||||
options.update(newoptions)
|
|
||||||
|
|
||||||
return super(stageuser_find, self).execute(self, *args, **options)
|
|
||||||
|
|
||||||
def pre_callback(self, ldap, filter, attrs_list, base_dn, scope, *keys, **options):
|
def pre_callback(self, ldap, filter, attrs_list, base_dn, scope, *keys, **options):
|
||||||
assert isinstance(base_dn, DN)
|
assert isinstance(base_dn, DN)
|
||||||
|
|
||||||
|
@ -730,10 +730,6 @@ class user_find(baseuser_find):
|
|||||||
return ("(&(objectclass=posixaccount)(krbprincipalname=%s))"%\
|
return ("(&(objectclass=posixaccount)(krbprincipalname=%s))"%\
|
||||||
getattr(context, 'principal'), base_dn, scope)
|
getattr(context, 'principal'), base_dn, scope)
|
||||||
|
|
||||||
newoptions = {}
|
|
||||||
self.common_enhance_options(newoptions, **options)
|
|
||||||
options.update(newoptions)
|
|
||||||
|
|
||||||
preserved = options.get('preserved', False)
|
preserved = options.get('preserved', False)
|
||||||
if preserved is None:
|
if preserved is None:
|
||||||
base_dn = self.api.env.basedn
|
base_dn = self.api.env.basedn
|
||||||
|
Loading…
Reference in New Issue
Block a user