go-ldap / ldap

Basic LDAP v3 functionality for the GO programming language.
Other
2.25k stars 355 forks source link

fix: remove trailing nul character at the end of ActiveDirectory errors #437

Closed fcinqmars closed 1 year ago

fcinqmars commented 1 year ago

This PR is to remove the trailing nul character added by ActiveDirectory when returning errors messages.

From Wireshark you can see it in the LDAP response: image

Then if I write the LDAP error from go-ldap into a file: image image

cpuschma commented 1 year ago

Hi fcinqmars,

thank you for your PR. As you pointed out in your Wireshark screenshots, this is not a bug of the library and just the plain LDAP result error returned from the directory server, in this case an Active Directory. The library currently does not have a single specialty for the various directory services and I would like to leave it at that, that the decision is always kept open for the developers to get to all the information.

I am always open to criticism and an open exchange and see this decision as reversible if a benefit can be gained from it.