s4-ldb: make DN escaping/unescaping consistent
authorAndrew Tridgell <tridge@samba.org>
Fri, 13 Nov 2009 06:48:35 +0000 (17:48 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 13 Nov 2009 08:32:46 +0000 (19:32 +1100)
commitdbae29de1c146d1c6d2e1e0a2a82593f85c8ba0d
treecd681b6fa99f865015b20cdbe199e3f01b28d85e
parentf9ad5cd133b57b66a3b71ede7829ef8c226f2224
s4-ldb: make DN escaping/unescaping consistent

The DN escape function was using the form \c where c is any
character. The unescape function was using \XX where XX is a 2 digit
hex number. The asymmetry led to quite a few problems when we start to
deal with DNs containing escape chars, such as CN=foo\0ADEL:XXX. The
result was a DN that was not accessible.

This patch changes the escaping to follow RFC2253 much more
closely. We accept either type of escape, and produce the two types of
escape, depending on the character being escaped
source4/lib/ldb/common/ldb_dn.c