From: Pierangelo Masarati Date: Fri, 7 May 2004 02:09:06 +0000 (+0000) Subject: fix escaped semicolon bug in back-bdb X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~401 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=80449c42d97495bb80db2e53fa8869d1416dbb98;p=openldap fix escaped semicolon bug in back-bdb --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index d6dd366165..aef5127b5e 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -336,9 +336,9 @@ bdb_cache_find_ndn( /* Advance to next lower RDN */ for (ptr = ei.bei_nrdn.bv_val - 2; ptr > ndn->bv_val - && !DN_SEPARATOR(*ptr); ptr--) /* empty */; + && !NDN_SEPARATOR(*ptr); ptr--) /* empty */; if ( ptr >= ndn->bv_val ) { - if (DN_SEPARATOR(*ptr)) ptr++; + if (NDN_SEPARATOR(*ptr)) ptr++; ei.bei_nrdn.bv_len = ei.bei_nrdn.bv_val - ptr - 1; ei.bei_nrdn.bv_val = ptr; } diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 3ea9dc2462..d6408f3fa9 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -133,7 +133,8 @@ LDAP_BEGIN_DECL || (c) == '(' || (c) == ')' || !ASCII_PRINTABLE(c) ) #define DN_ESCAPE(c) ((c) == SLAP_ESCAPE_CHAR) -#define DN_SEPARATOR(c) ((c) == ',' || (c) == ';') +#define NDN_SEPARATOR(c) ((c) == ',') +#define DN_SEPARATOR(c) (NDN_SEPARATOR(c) || (c) == ';') #define RDN_ATTRTYPEANDVALUE_SEPARATOR(c) ((c) == '+') /* RFC 2253 */ #define RDN_SEPARATOR(c) (DN_SEPARATOR(c) || RDN_ATTRTYPEANDVALUE_SEPARATOR(c)) #define RDN_NEEDSESCAPE(c) ((c) == '\\' || (c) == '"')