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

parseDistinguishedName() only escapes the first instance of '\\,' #212

Open
christianpesantestorres opened this issue Aug 6, 2019 · 0 comments

Comments

@christianpesantestorres
Copy link

christianpesantestorres commented Aug 6, 2019

The function parseDistinguishedName(dn) returns dn.replace('\\,', '\\\\,') but when the first argument for replace is a string (like in this scenario), only the first instance of said string is replaced. (source)

Thus, when dn has multiple instances of \\, then dn will not be properly escaped and some functions may not behave as expected. I ran into this issue when getGroupMembershipForUser() would return an empty array but no errors.

A potential solution would be to replace the return with something like: return(dn.split('\\,').join('\\\\,'));. So far this has been working for me, but please let me know if I'm missing anything. I will create a PR for this soon. Thanks!

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

1 participant