New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update get_attr_filter in LDAPSearch to handle nsaccountlock user searches #688
Conversation
ipaserver/plugins/baseldap.py
Outdated
| if name == 'nsaccountlock' and value == False: | ||
| # If nsaccountlock is False, set the value to True and | ||
| # search for nsaccountlock != True. This way we can search | ||
| # for any users where nsaccountlock=False or nsaccountlock=None. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No magic special cases please, the whole point of doing this in baseldap is that the fix would be generic. If the bit below doesn't work, we need to figure out how to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, figured it out:
- The
nsaccountlockparam inuserplugin does not have a default value specified. - The check for default value below should actually look like this:
default = self.get_default_of(name, **options) if default is not None and value == default: fltr = ldap.combine_filters([fltr, '(!({}=*))'.format(name)])
183eba4
to
a5a1428
Compare
|
@HonzaCholasta ready for your review. |
|
Bump for review |
|
Should this also go into the 4.5 branch? |
|
I guess it should. Could you please file a ticket? |
|
Thanks! |
|
Actually, please remove the change in Also please add the ticket link to commit messages. |
…rches - Update get_attr_filter in LDAPSearch to handle nsaccountlock by setting the default value for nsaccountlock to false as well as update the filter to check for the default value - Remove pytest xfail for test_find_enabled_user https://pagure.io/freeipa/issue/6896
9346349
to
cbc48ae
Compare
|
@HonzaCholasta I removed the change to |
Update get_attr_filter in LDAPSearch to handle nsaccountlock by setting the default value for
nsaccountlock to false as well as update the filter to check for the default value
https://pagure.io/freeipa/issue/6896