Skip to content
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

ipaserver/dcerpc.py: handle indirect topology conflicts #2071

Closed
wants to merge 1 commit into from

Conversation

abbra
Copy link
Contributor

@abbra abbra commented Jun 26, 2018

When AD forest A has a trust with a forest B that claims ownership of a domain name (TLN) owned by an IPA forest, we need to build exclusion record for that specific TLN, not our domain name.

Use realmdomains to find a correct exclusion entry to build, not just using our own domain name.

Fixes: https://pagure.io/freeipa/issue/7370

@abbra
Copy link
Contributor Author

abbra commented Jun 26, 2018

Note that the original bug https://bugzilla.redhat.com/show_bug.cgi?id=1533803 has some unrelated misconfiguration issue which prevented tests to perform properly. However, its log actually showed this bug which I didn't notice originally due to that unrelated misconfiguration.

@abbra abbra added the re-run Trigger a new run of PR-CI label Jun 26, 2018
@freeipa-pr-ci freeipa-pr-ci removed the re-run Trigger a new run of PR-CI label Jun 26, 2018
for e in dominfo.entries:
e1 = lsa.ForestTrustRecord()
e1.type = e.type
e1.flags = e.flags
e1.time = e.time
e1.forest_trust_data = e.forest_trust_data
try:
Copy link
Member

Choose a reason for hiding this comment

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

(nitpicking) my humble suggestion to improve readability:

is_our_record = False  # or even is_conflicting = False
# ...
for record in another_domain.ftinfo_records:
    if record['rec_name'] == e.forest_trust_data.string:
        is_our_record = True
        break

if is_our_record:
    # ...

When AD forest A has a trust with a forest B that claims ownership
of a domain name (TLN) owned by an IPA forest, we need to build
exclusion record for that specific TLN, not our domain name.

Use realmdomains to find a correct exclusion entry to build.

Fixes: https://pagure.io/freeipa/issue/7370
@abbra
Copy link
Contributor Author

abbra commented Jun 26, 2018

@netoarmando thanks, I've updated the code to follow your suggestion and added few more comments.

Copy link
Member

@tiran tiran left a comment

Choose a reason for hiding this comment

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

Yeah, that's much more readable. Thanks!

in another_domain.ftinfo_records
if (x['rec_name'] ==
e.forest_trust_data.string))
except StopIteration:
Copy link
Member

Choose a reason for hiding this comment

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

This code block is hard to understand. After a couple of minutes, I'm still not sure that I got it right. Is it equivalent to this code?

for record in another_domain.ftinfo_records:
    if x['rec_name'] == e.forest_trust_data.string:
        our_record = record
        e1.type = lsa.LSA_FOREST_TRUST_TOP_LEVEL_NAME_EX
        e1.flags = 0
        e1.time = trust_timestamp
        break

@netoarmando netoarmando added the ack Pull Request approved, can be merged label Jun 27, 2018
@netoarmando
Copy link
Member

master:

  • 81f36df ipaserver/dcerpc.py: handle indirect topology conflicts

@netoarmando netoarmando added the pushed Pull Request has already been pushed label Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
4 participants