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

MISC: attrs_parse() fixed error when multi-line value appeared #53

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

patriki01
Copy link
Contributor

When LDAP attributes values are too long, they split into multiple lines. It can look like the example provided, where originalDN is the problematic attribute:

# record 11
dn: name=ae3c2c8c-4b8f-11ee-ac71-c6e1a1a33042,cn=hbac_rules,cn=custom,cn=test,cn=sysdb
originalDN: ipaUniqueID=ae3c2c8c-4b8f-11ee-ac71-c6e1a1a33042,cn=hbac,dc=ipa,dc
 =test
serviceCategory: all

And this caused an error in attrs_parse() function. I added two tests to check this error, so look there for better understanding of the problem.
This is not a very nice solution, but I couldn't think of a better one. Feel free to suggest changes.

@patriki01 patriki01 added the bug Something isn't working label Oct 12, 2023
@patriki01
Copy link
Contributor Author

I improved the code and also added the test case you mentioned.

@patriki01 patriki01 requested a review from thalman October 19, 2023 08:32
sssd_test_framework/misc/__init__.py Outdated Show resolved Hide resolved
tests/test_misc.py Outdated Show resolved Hide resolved
@patriki01
Copy link
Contributor Author

Feedback resolved

Copy link
Contributor

@thalman thalman left a comment

Choose a reason for hiding this comment

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

Thanks @patriki01 for the effort. Looks great now :)
ACK

@pbrezina pbrezina merged commit c09aee2 into SSSD:master Oct 23, 2023
2 checks passed
@patriki01 patriki01 deleted the fix_attrs_pars branch October 23, 2023 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants