Description of problem: Add this entry: dn: ou=\#\ ,dc=example,dc=com objectClass: organizationalUnit objectClass: top Search result: dn: ou=\#\ ,dc=example,dc=com objectClass: organizationalUnit objectClass: top ou: # Exported entry: # entry-id: 11 dn: ou=\#\,dc=example,dc=com objectClass: organizationalUnit objectClass: top ou: # creatorsName: cn=directory manager modifiersName: cn=directory manager createTimestamp: 20100316171116Z modifyTimestamp: 20100316171116Z nsUniqueId: d4994a81-311e11df-ab07d9d1-eac8aaf9 Expected results: Expected search result & exported entry: dn: ou=\23\20,dc=example,dc=com objectClass: organizationalUnit objectClass: top ou:: IyA=
Created attachment 409555 [details] git patch file (master) Files: ldap/ldif/template-suffix-db.ldif.in ldap/servers/slapd/dn.c Bug Description: If a DN contains "\ " at the end of its RDN, it's be converted to "\20" by slapi_dn_normalize_ext in the add operation. But the following search returns ' ' (not an escaped space). Fix Description: When slapi_dn_normalize_ext was applied to a string which contains "\20", it converted the string to ' '. This fix changes the behaviour so that the string "\20" in DN remains untouched. Also, this patch includes a fix to add a default suffix value with no double quotes in template-suffix-db.ldif.in. We keep double quoted suffix for the backward compatibility.
Created attachment 409577 [details] test data (suffix: dc=example,dc=com) How to verify the bug: 1) add the test data $ /usr/lib[64]/mozldap/ldapmodify -a -f /path/to/test.ldif 2) run the search and see these 6 DNs $ /usr/lib[64]/mozldap/ldapsearch -b "dc=example,dc=com" "(ou=#*)" dn dn: ou=\23,dc=example,dc=com dn: ou=\23\20,dc=example,dc=com dn: ou=\23#,dc=example,dc=com dn: ou=\23\3C,dc=example,dc=com dn: ou=\23\2C\2B\22\5C\3E:\3D\3C\3C\3E\3B/,dc=example,dc=com dn: ou=\23\2C\2B\22\5C\3E:\3D\3C\3C\3E\3B/\20,dc=example,dc=com
Reviewed by Nathan (Thank you!!) Pushed to master. $ git merge work Updating b65b3c9..0501282 Fast forward ldap/ldif/template-suffix-db.ldif.in | 1 + ldap/servers/slapd/dn.c | 29 ++++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) $ git push Counting objects: 15, done. Delta compression using 4 threads. Compressing objects: 100% (8/8), done. Writing objects: 100% (8/8), 1.37 KiB, done. Total 8 (delta 6), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git b65b3c9..0501282 master -> master
fix verified - redhat-ds-base-8.2.0-2010050604.el5dsrv - RHEL 5.5 32 bit ldapsearch -x -h hostname.redhat.com -p 389 -D "cn=Directory Manager" -w secret -b "dc=example, dc=com" "(ou=#*)" dn # extended LDIF # # LDAPv3 # base <dc=example, dc=com> with scope subtree # filter: (ou=#*) # requesting: dn # # \23, example.com dn: ou=\23,dc=example,dc=com # \23\20, example.com dn: ou=\23\20,dc=example,dc=com # \23#, example.com dn: ou=\23#,dc=example,dc=com # \23\3C, example.com dn: ou=\23\3C,dc=example,dc=com # \23\2C\2B\22\5C\3E:\3D\3C\3C\3E\3B/, example.com dn: ou=\23\2C\2B\22\5C\3E:\3D\3C\3C\3E\3B/,dc=example,dc=com # \23\2C\2B\22\5C\3E:\3D\3C\3C\3E\3B/\20, example.com dn: ou=\23\2C\2B\22\5C\3E:\3D\3C\3C\3E\3B/\20,dc=example,dc=com # search result search: 2 result: 0 Success # numResponses: 7 # numEntries: 6