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

Illegal Unescaped Char : ( #247

Open
nandsfordays opened this issue May 16, 2023 · 2 comments
Open

Illegal Unescaped Char : ( #247

nandsfordays opened this issue May 16, 2023 · 2 comments

Comments

@nandsfordays
Copy link

I am using the getMembershipForUser function and trying to get a list of all the Groups that a member is in. This function has worked for every user so far except for one. I get this error:
Error: illegal unescaped char: (
at escapeValue (/server/node_modules/ldap-filter/lib/index.js:49:13)
at parseExpr (/server/node_modules/ldap-filter/lib/index.js:167:16)
at parseFilter /server/node_modules/ldap-filter/lib/index.js:228:14)
at Object.parse (/server/node_modules/ldap-filter/lib/index.js:252:18)
at Object.parseString (portal44/server/node_modules/ldapjs/lib/filters/index.js:179:27)
at Client.search (server/node_modules/ldapjs/lib/client/client.js:569:30)
at ActiveDirectory.search (/app/data/portal/portal44/server/node_modules/activedirectory/lib/activedirectory.js:529:10)
at ActiveDirectory.getGroupMembershipForDN (server/node_modules/activedirectory/lib/activedirectory.js:740:10)
at server/node_modules/activedirectory/lib/activedirectory.js:770:33
at server/node_modules/async/dist/async.js:2588:44

I am unsure of why the open paranthesis '(' would cause this error. It does not need to be escaped at any other time. I think is that one of the OU parts of the dn has an open paranthesis '(' for example: CN={CN NAME},OU=FPLS (Fed Parent Locator Svc),OU=Security,... {more information}
I am unable to change security groups and as soon as it hits the getMembershipForUser function it crashes the entire process and my process manager restarts. Just wondering if there is anyway to work around this.

"activedirectory": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/activedirectory/-/activedirectory-0.7.2.tgz",

    "requires": {
    "async": ">= 0.1.22",
    "bunyan": ">= 1.3.5",
    "ldapjs": ">= 0.7.1",
    "underscore": ">= 1.4.3"
  }
}

"ldapjs": {
"version": "2.2.3",

@nandsfordays
Copy link
Author

Made a typo and the function I was calling getMembershipForUser is supposed to be getGroupMembershipForUser but everything else is still relevant

@El1rans
Copy link

El1rans commented Jun 5, 2023

Hi, i have the same issue

found this:

#230 (comment)

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

2 participants