URL:
https://github.com/freeipa/freeipa/pull/3289
Author: flo-renaud
Title: #3289: stageuser-find: fix search with non-posix user
Action: opened
PR body:
"""
### stageuser-find: fix search with non-posix user
`ipa stageuser-find` fails to return a staged user if it does not contain the posixaccount
objectclass.
The code is replacing the search filter (objectclass=posixaccount) with
(|(objectclass=posixaccount)(objectclass=inetorgperson)) so it should work in theory.
The issue is that on python2 the filter has been hexlified before reaching the stageuser
plugin, hence filter.replace does not recognize the pattern (objectclass=posixaccount).
The fix consists in creating the filter with a call to ldap.make_filter_from_attr() that
will hexlify too, if needed.
Fixes:
https://pagure.io/freeipa/issue/7983
### ipatests: add a test for stageuser-find with non-posix account
Add a new XMLRPC test with the following scenario:
- ldapadd a user without the posixaccount objectclass
- call ipa stageuser-find <user>
- check that 1 entry is returned
Related:
https://pagure.io/freeipa/issue/7983
"""
To pull the PR as Git branch:
git remote add ghfreeipa
https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/3289/head:pr3289
git checkout pr3289