Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Whitespaces in DN #80

Closed
kd42 opened this issue Jun 26, 2012 · 2 comments
Closed

Whitespaces in DN #80

kd42 opened this issue Jun 26, 2012 · 2 comments

Comments

@kd42
Copy link

kd42 commented Jun 26, 2012

This is an issue with a legacy LDAP client I am using, that I cannot change.
My problem is that the ldapjs server always sends back DNs in the format "dc=example, dc=com", with a space after each comma.
Is it possible to change this behaviour to send back a DN without any whitespaces?

@mcavage
Copy link
Contributor

mcavage commented Jun 26, 2012

Not right now; right now the DN serialization logic all just does
that, as you know, that's what most things want ;). I sort of figured
this random crap with old LDAP clients would come up from to time.

Realistically to do this, I'd need to make this an environment
variable that you would hackily set. In dn.js is a .toString()
method => all of the BER stuff calls that when serializing onto the
wire. Basically, we'd just put in a hacky thing that replaces the
.join(', ') with .join(process.env.LDAPJS_HACK_DN || ', ') or some
such. If you want to try and change that locally and let me know if it
works for you, that would be cool.

m

On Tue, Jun 26, 2012 at 8:26 AM, kd42
reply@reply.github.com
wrote:

This is an issue with a legacy LDAP client I am using, that I cannot change.
My problem is that the ldapjs server always sends back DNs in the format "dc=example, dc=com", with a space after each comma.
Is it possible to change this behaviour to send back a DN without any whitespaces?


Reply to this email directly or view it on GitHub:
#80

@kd42
Copy link
Author

kd42 commented Jun 26, 2012

I made the modification, and I had to change another thing, because I still needed an exact match for the DN.
So I made the attr.toLowerCase optional in the parse function of dn.js. I know it will possibly come back to bite me, with many similar RDNs only differing in letter cases, but it is working good at the moment.
Oh, and thanks for the quick response! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants