Page MenuHomePhabricator

Restore ldaplist -l passwd
Closed, InvalidPublic

Description

The new openldap servers have tighter limits on unindexed searches. That results in:

$ ldaplist -l passwd
The search returned an error.

If there's a compelling reason to keep those limits low then I can live with this, but there are a fair number of useful workflows that begin with 'list all users, grep for X' which are no somewhat uglier.

Event Timeline

Andrew assigned this task to MoritzMuehlenhoff.
Andrew raised the priority of this task from to Needs Triage.
Andrew updated the task description. (Show Details)
Andrew added projects: Cloud-Services, LDAP.
Andrew subscribed.
Andrew closed subtask Restricted Task as Resolved.Dec 29 2015, 9:30 PM
chasemp reopened subtask Restricted Task as Open.Dec 29 2015, 11:38 PM

I have a patch for that which is working fine, but there's been an API change in python-ldap 2.3 (precise) and 2.4 (trusty, jessie). Do we also need this in precise?`Then I would need to implement some alternate fallback in the old API.

I don't care if it's broken in precise. Can it detect and fail gracefully?

Ok, I'll simply not use the server control for paged searches when using python-ldap < 2.4, then.

Andrew closed subtask Restricted Task as Declined.Jan 22 2016, 11:29 PM
chasemp subscribed.

Ok, I'll simply not use the server control for paged searches when using python-ldap < 2.4, then.

can be resolved?

My old patch from https://gerrit.wikimedia.org/r/#/c/262745/ was wrong, it still needs more work to actually request the followup pages,

Change 295177 had a related patch set uploaded (by Tim Landscheidt):
WIP: ldap: Make ldaplist use paging for queries

https://gerrit.wikimedia.org/r/295177

My WIP patch works in principle, and I'll add the Precise compatibility, but:

It will fail for ldaplist passwd because there are getent passwd | wc -l = 3525 entries for users, but size_limit (I assume) is set to the default 2048, so it can never retrieve all users.

Can size_limit be increased to 4096 (or more)?

Change 295198 had a related patch set uploaded (by Muehlenhoff):
Bump the size limit for labs openldap server to 4096

https://gerrit.wikimedia.org/r/295198

I've created https://gerrit.wikimedia.org/r/#/c/295198/ to raise the size limit. The reason my patch and our patch are not effective is because OpenLDAP handles paged search requests differently from Active Directory (for which all of those docs are usually written since AD applies a fairly tiny size limit by default (1000): OpenLDAP applies the size limit to the sum of all paged requests, while AD applies them per page. So the only real fix is to raise the limit.

Change 295177 abandoned by Tim Landscheidt:
WIP: ldap: Make ldaplist use paging for queries

Reason:
Cf. I198d39.

https://gerrit.wikimedia.org/r/295177

Change 295198 abandoned by Muehlenhoff:
Bump the size limit for labs openldap server to 4096

https://gerrit.wikimedia.org/r/295198

Note that T114063 is about dropping ldapsupportlib.py and thus ldaplist.

bd808 subscribed.

Closing as invalid which probably isn't technically correct, but paged searches certainly work.