dsbenghe / Novell.Directory.Ldap.NETStandard

.NET LDAP client library for .NET Standard >= 2.0, .NET Core >=1.0, NET5/NET6/NET7/NET8 - works with any LDAP protocol compatible directory server (including Microsoft Active Directory).
MIT License
558 stars 153 forks source link

Comma values in query cause LDAPLocalException #194

Open RyanGaudion opened 2 years ago

RyanGaudion commented 2 years ago

Might be related to #175 - When running the following code I receive the error below:

var searchFilter = "(&(objectClass=group)(member:1.2.840.113556.1.4.1941:=CN=Ryan\\, Gaudion,CN=w,DC=x,DC=y,DC=z,DC=com))";
LdapSearchResults results = (LdapSearchResults)connection.Search(config.SearchBase, LdapConnection.ScopeSub, searchFilter, null, false, cons);

Exception: {"Type":"Novell.Directory.Ldap.LdapLocalException", "ResultCode":87, "Message":"Filter Error", "TargetSite":"Byte[] UnescapeString(System.String)", "StackTrace":" at Novell.Directory.Ldap.Rfc2251.RfcFilter.UnescapeString(String stringRenamed)\n at Novell.Directory.Ldap.Rfc2251.RfcFilter.ParseFilterComp()\n at Novell.Directory.Ldap.Rfc2251.RfcFilter.ParseFilterList()\n at Novell.Directory.Ldap.Rfc2251.RfcFilter.ParseFilterComp()\n at Novell.Directory.Ldap.Rfc2251.RfcFilter.ParseFilter()\n at Novell.Directory.Ldap.Rfc2251.RfcFilter..ctor(String filter)\n at Novell.Directory.Ldap.LdapSearchRequest..ctor(String baseRenamed, Int32 scope, String filter, String[] attrs, Int32 dereference, Int32 maxResults, Int32 serverTimeLimit, Boolean typesOnly, LdapControl[] cont)\n at Novell.Directory.Ldap.LdapConnection.Search......