Skip to content

syncrepl cookie code only works with single provider systems #562

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

Open
quanah opened this issue Apr 11, 2024 · 5 comments
Open

syncrepl cookie code only works with single provider systems #562

quanah opened this issue Apr 11, 2024 · 5 comments

Comments

@quanah
Copy link
Contributor

quanah commented Apr 11, 2024

If you found a bug in python-ldap, or would request a new feature,
this is the place to let us know.

Please describe the issue and your environment here.


Issue description:

The syncrepl code included with python-ldap only functions when there is a single contectCSN value in use. If the LDAP system is multi-provider, only one CSN value is stored, causing the code to always execute a REFRESH on startup.

Steps to reproduce:

Set up a multi-provider environment, use the syncrepl API to execute refresh

Operating system:

linux

Python version:
3.10.12

python-ldap version:
3.4.3

@mistotebe
Copy link
Contributor

RFC4533 doesn't let consumers peek inside the cookie.

What you're describing is OpenLDAP's extensions to syncrepl to support multiprovider replication. RFC4533 compliant refreshOnly consumers are not affected but refreshAndPersist consumers are not compatible as you just found out.

@quanah
Copy link
Contributor Author

quanah commented Apr 12, 2024

I'd suggest at least documenting that it's unusable with OpenLDAP MPR then.

@tiran
Copy link
Member

tiran commented Apr 14, 2024

+1 for documenting the behavior

I would be open to add an extended syncrepl client that can handle MPR if somebody provides a patch.

@tiran tiran reopened this Apr 14, 2024
@quanah
Copy link
Contributor Author

quanah commented Apr 19, 2024

Ok, so a note - refreshOnly when used with a multi-provider system works in regards to the cookie code. It's refreshAndPersist specifically where this is need work to handle OpenLDAP's MPR code.

@mistotebe
Copy link
Contributor

Looking into this, should be possible to either expose a subclass of SyncreplConsumer or provide an OpenLDAP specific cookie class.

On a side note, it's a little concerning that the ASN.1 definition seems to make the assumption the cookie decodes to a UTF-8 string, rather than an octetstring (bytes) which is what it should be doing. This might need to be fixed eventually as well, just luck that noone used this with a provider that does make the cookie contain arbitrary data.

mistotebe added a commit to mistotebe/python-ldap that referenced this issue Jun 25, 2024
mistotebe added a commit to mistotebe/python-ldap that referenced this issue Jun 25, 2024
mistotebe added a commit to mistotebe/python-ldap that referenced this issue Jun 25, 2024
mistotebe added a commit to mistotebe/python-ldap that referenced this issue Jun 25, 2024
mistotebe added a commit to mistotebe/python-ldap that referenced this issue Aug 20, 2024
mistotebe added a commit to mistotebe/python-ldap that referenced this issue Aug 20, 2024
mistotebe added a commit to mistotebe/python-ldap that referenced this issue Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants