LDAP 过滤器规范为以下字符分配特殊含义,当在搜索过滤器( rfc2254* ( ) \ NUL
) 中使用时,应使用反斜杠后跟该字符的两个字符 ASCII 十六进制表示进行转义:
* \2A
( \28
) \29
\ \5C
Nul \00
这意味着用于转义专有名称的特殊字符(包括逗号)的任何反斜杠必须\5c
在搜索过滤器中表示为:
(&(objectClass=group)(memberof:1.2.840.113556.1.4.1941:=CN=Whalen\5c, Sean,OU=Users,OU=Users and Groups,DC=example,DC=net))
以下是在搜索过滤器中使用时必须使用\
或 whith转义的 dn 特殊字符列表:\5C
+-------------------------------+---+
| comma | , |
+-------------------------------+---+
| Backslash character | \ |
+-------------------------------+---+
| Pound sign (hash sign) | # |
+-------------------------------+---+
| Plus sign | + |
+-------------------------------+---+
| Less than symbol | < |
+-------------------------------+---+
| Greater than symbol | > |
+-------------------------------+---+
| Semicolon | ; |
+-------------------------------+---+
| Double quote (quotation mark) | " |
+-------------------------------+---+
| Equal sign | = |
+-------------------------------+---+
| Leading or trailing spaces | |
+-------------------------------+---+