Skip to content

4224 openldap entryuuid confusion #4344

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

Merged
merged 3 commits into from
Dec 9, 2020

Conversation

Firstyear
Copy link
Contributor

@Firstyear Firstyear commented Sep 28, 2020

Bug Description: OpenLDAP server as a syncrepl consumed enforces
the condition that syncUUID in ldap messages must match the entryuuid
of the entry. This is not in the RFC but it affects this one situation.

Fix Description: To resolve this, we enforce that entryuuid is a
requirement to the openldap syncrepl mode. Only entries with an
entryuuid can be sent to openldap. Additionally, this mode is disabled
by default by a configuration parameter "syncrepl-allow-openldap" in
the content sync plugin config.

NOTE: It looks like the commits from 51260 which were previously merged seem to be missing after the migration, so this branch includes those.

Thanks!

Fixes: #4313 #4224

@Firstyear Firstyear requested a review from tbordaz September 28, 2020 05:41
Copy link
Contributor

@tbordaz tbordaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Firstyear the overall patch looks very nice. I have minor comments. However I would appreciate a design (port389) describing the solution and the choices

@Firstyear Firstyear force-pushed the 4224-openldap-entryuuid-confusion branch from b456330 to 5eb10cc Compare October 6, 2020 01:27
@Firstyear
Copy link
Contributor Author

@tbordaz Thanks for your review, I have updated all the areas you commented on, and I have updated https://www.port389.org/docs/389ds/design/openldap2ds.html with details about the syncrepl changes.

@Firstyear
Copy link
Contributor Author

@tbordaz, @mreynolds389 Review reminder :)

@Firstyear
Copy link
Contributor Author

Ping @tbordaz and @mreynolds389 :)

@Firstyear Firstyear closed this Oct 19, 2020
@Firstyear Firstyear reopened this Oct 19, 2020
@Firstyear
Copy link
Contributor Author

Ping @tbordaz and @mreynolds389,

@Firstyear Firstyear added this to the 1.4.4 milestone Nov 20, 2020
@mreynolds389
Copy link
Contributor

@tbordaz has been doing a lot of work around sync repl lately. I'd prefer him to do this review as it could impact what he is working on

@Firstyear
Copy link
Contributor Author

Yeah, that's fair @mreynolds389. I'll poke him some more then about the matter :)

@Firstyear Firstyear force-pushed the 4224-openldap-entryuuid-confusion branch from 5eb10cc to da51939 Compare December 1, 2020 02:52
@tbordaz
Copy link
Contributor

tbordaz commented Dec 2, 2020

@Firstyear except those two last comments/questions, the overall patch looks nice to me

@Firstyear
Copy link
Contributor Author

Hey mate, I don't see the two comments/questions you are referring to? All the comments I can see are your older ones which have been addressed?

@tbordaz
Copy link
Contributor

tbordaz commented Dec 3, 2020

@Firstyear , definitely something I do not understand with PR. Some comments can remain "hidden" and some others are public.. I do not know what to do to make all my comments public. Can you see my two comments (sync_create_state_control, null cookie) ?

@Firstyear
Copy link
Contributor Author

@Firstyear , definitely something I do not understand with PR. Some comments can remain "hidden" and some others are public.. I do not know what to do to make all my comments public. Can you see my two comments (sync_create_state_control, null cookie) ?

If you start a review, your comments are "staged" in your browser, and only if you click "complete review" in the top right do they become visible to me and others. Maybe that's what is going on?

@Firstyear
Copy link
Contributor Author

@tbordaz I think your python tests are failing because of this python-ldap/python-ldap#351

I indicated in a comment how to check your python ldap version for this :)

@tbordaz
Copy link
Contributor

tbordaz commented Dec 4, 2020

@tbordaz I think your python tests are failing because of this python-ldap/python-ldap#351

I indicated in a comment how to check your python ldap version for this :)

Exactly !! you can not imagine the amount of time I spent to identify that the failure was due to incorrect python-ldap failing to decode syncInfo. As I am still testing with prefix_install I was using an old version of python-ldap. Thanks for having fixed that.
This python-ldap bug impacted test_syncrepl_basic but others sync_repl tests were failing because of invalid testcase. Now all is fixed upstream

@Firstyear
Copy link
Contributor Author

@tbordaz Okay, I've updated this - I've fixed the null deref, and added flags to the tests to prevent them running if python ldap is too old, as well as checkingf for enable-rust which gives the entry uuid support. I've run all the sync repl tests and they all pass.

@tbordaz
Copy link
Contributor

tbordaz commented Dec 7, 2020

@tbordaz Okay, I've updated this - I've fixed the null deref, and added flags to the tests to prevent them running if python ldap is too old, as well as checkingf for enable-rust which gives the entry uuid support. I've run all the sync repl tests and they all pass.

Sorry, I can not see the changes in the patch. Am I missing something ?

@Firstyear Firstyear force-pushed the 4224-openldap-entryuuid-confusion branch from da51939 to 7320dd6 Compare December 7, 2020 23:52
@Firstyear
Copy link
Contributor Author

Sorry, I can not see the changes in the patch. Am I missing something ?

Nope, I made a mistake in my push - I pushed the branch to the upstream project, rather than my fork. No damage done to upstream since it was a unique branch name, so I have deleted the mistake, and now pushed to the correct branch. You should now see the changes. Sorry about that :(

@Firstyear Firstyear force-pushed the 4224-openldap-entryuuid-confusion branch from 7320dd6 to 47e245a Compare December 8, 2020 00:52
Copy link
Contributor

@tbordaz tbordaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. LGTM. Ack

@Firstyear
Copy link
Contributor Author

Thanks @tbordaz I might ask @mreynolds389 getting a second look over as well. Really appreciate your help :)

@mreynolds389
Copy link
Contributor

LGTM

Bug Description: The cookie encodes which changelog entries we
have seen up to and including. However, the sync process would then
re-send the cl item from the cookie number. This could cause corruption
in some cases as some combinations of actions between two points
are no-oped in the server.

Fix Description: Fix the changelog search to always process that
entries of the CL must be greater than, but not equal to the
already seen CL items from the cookie.

Fixes: 389ds#4313

Author: William Brown <william@blackhats.net.au>

Review by: @tbordaz
Bug Description: This is a supplement to 51260.

Fix Description: This expands the test cases to be able to detect
the subsequent data corruption of 51260. This also improves
documentation around the rfc, and some todo comments for
future work with entryuuid + openldap.

Fixes: 389ds#4313

Author: William Brown <william@blackhats.net.au>

Review by: @tbordaz
Bug Description: OpenLDAP server as a syncrepl consumed enforces
the condition that syncUUID in ldap messages must match the entryuuid
of the entry. This is not in the RFC but it affects this one situation.

Fix Description: To resolve this, we enforce that entryuuid is a
requirement to the openldap syncrepl mode. Only entries with an
entryuuid can be sent to openldap. Additionally, this mode is disabled
by default by a configuration parameter "syncrepl-allow-openldap" in
the content sync plugin config.

Fixes: 389ds#4224

Author: William Brown <william@blackhats.net.au>

Review by: @tbordaz (Thanks!)
@Firstyear Firstyear force-pushed the 4224-openldap-entryuuid-confusion branch from 47e245a to ce7ec36 Compare December 9, 2020 23:29
@Firstyear Firstyear merged commit 5a3a6e5 into 389ds:master Dec 9, 2020
@Firstyear Firstyear deleted the 4224-openldap-entryuuid-confusion branch December 9, 2020 23:29
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

Successfully merging this pull request may close these issues.

Syncrepl may send changelog entries twice causing client data corruption
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy