Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Ldap] Incorrect determination of RelativeDistinguishedName for the "move" operation#39518

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jderusse merged 1 commit intosymfony:4.4fromastepin:issue_ldap_rdn
Dec 17, 2020

Conversation

@astepin
Copy link
Contributor

@astepinastepin commentedDec 15, 2020
edited
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

If the specified "DistinguishedName" contains a comma in the first value, the first "RelativeDistinguishedName" was determined incorrectly.
The regular expression now matches up to the first comma which was not escaped with backslash.

Testing private methods is a bit messy here. However, I thought it was better than testing this against an LDAP server.

Source:https://tools.ietf.org/html/rfc4514#section-3

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

Copy link
Contributor

@OskarStarkOskarStark left a comment

Choose a reason for hiding this comment

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

First of all, thanks for your contribution 👍 Well done for your first time here 🎉

As this is a bugfix it should target the lowest maintained branch which contains this bug, so4.4?

{
return [
['CN=Simple,DC=example,DC=net','CN=Simple'],
['CN=James \"Jim\" Smith\, III,DC=example,DC=net','CN=James \"Jim\" Smith\, III'],

Choose a reason for hiding this comment

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

Sorry if it's a dumb question: should the expected value be'CN=James "Jim" Smith, III'?

Copy link
ContributorAuthor

@astepinastepinDec 17, 2020
edited
Loading

Choose a reason for hiding this comment

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

Certain characters in the canonical name must be escaped for them to work with LDAP server.

So to continue working with the LDAP server we need the backslash in front of the quotes. => CN=James \"Jim\" Smith\, III

privatefunctionparseRdnFromEntry(Entry$entry):string
{
if (!preg_match('/^([^,]+),/',$entry->getDn(),$matches)) {
if (!preg_match('/(^[^,\\\\]*(?:\\\\.[^,\\\\]*)*),/',$entry->getDn(),$matches)) {

Choose a reason for hiding this comment

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

the regexp won't work when several\ are used, eg with\\\\ or\\\\\,,isn't it?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

The number of\ shouldn't matter. Compared to the old code, basically the same is done, except that now the comma is not matched if it is escaped with a\.

It's a bit tricky with the "not matching regex groups" (starting with ?: ). It is quite hard to read and understand.

@jderusse
Copy link
Member

Thank you@astepin.

@jderussejderusse merged commita316a31 intosymfony:4.4Dec 17, 2020
@astepinastepin deleted the issue_ldap_rdn branchDecember 17, 2020 11:41
This was referencedDec 18, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark requested changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@jderussejderussejderusse approved these changes

@chalasrchalasrAwaiting requested review from chalasr

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

@wouterjwouterjAwaiting requested review from wouterj

@xabbuhxabbuhAwaiting requested review from xabbuh

@ycerutoycerutoAwaiting requested review from yceruto

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@astepin@carsonbot@jderusse@nicolas-grekas@OskarStark

[8]ページ先頭

©2009-2025 Movatter.jp