diff --git a/SOURCES/0013-Issue-4297-2nd-fix-for-on-ADD-replication-URP-issue-.patch b/SOURCES/0013-Issue-4297-2nd-fix-for-on-ADD-replication-URP-issue-.patch new file mode 100644 index 0000000..d36f5f8 --- /dev/null +++ b/SOURCES/0013-Issue-4297-2nd-fix-for-on-ADD-replication-URP-issue-.patch @@ -0,0 +1,63 @@ +From 19f44a6e703c16e807a51da2bfbd36b414041101 Mon Sep 17 00:00:00 2001 +From: Thierry Bordaz +Date: Wed, 25 Nov 2020 18:32:51 +0100 +Subject: [PATCH 1/2] Issue 4297: 2nd fix for on ADD replication URP issue + internal searches with filter containing unescaped chars + +Bug description: + Previous fix is buggy because slapi_filter_escape_filter_value returns + a escaped filter component not an escaped assertion value. + +Fix description: + use the escaped filter component + +relates: #4297 + +Reviewed by: Mark Reynolds, William Brown (thanks !) + +Platforms tested: F31 +--- + ldap/servers/plugins/replication/urp.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/ldap/servers/plugins/replication/urp.c b/ldap/servers/plugins/replication/urp.c +index 2c2d83c6c..586c6936d 100644 +--- a/ldap/servers/plugins/replication/urp.c ++++ b/ldap/servers/plugins/replication/urp.c +@@ -1379,12 +1379,12 @@ urp_add_check_tombstone (Slapi_PBlock *pb, char *sessionid, Slapi_Entry *entry, + Slapi_Entry **entries = NULL; + Slapi_PBlock *newpb; + char *basedn = slapi_entry_get_ndn(entry); +- char *escaped_basedn; ++ char *escaped_filter; + const Slapi_DN *suffix = slapi_get_suffix_by_dn(slapi_entry_get_sdn (entry)); +- escaped_basedn = slapi_filter_escape_filter_value("nscpentrydn", basedn); ++ escaped_filter = slapi_filter_escape_filter_value("nscpentrydn", basedn); + +- char *filter = slapi_filter_sprintf("(&(objectclass=nstombstone)(nscpentrydn=%s))", escaped_basedn); +- slapi_ch_free((void **)&escaped_basedn); ++ char *filter = slapi_filter_sprintf("(&(objectclass=nstombstone)%s)", escaped_filter); ++ slapi_ch_free((void **)&escaped_filter); + newpb = slapi_pblock_new(); + slapi_search_internal_set_pb(newpb, + slapi_sdn_get_dn(suffix), /* Base DN */ +@@ -1577,12 +1577,13 @@ urp_find_tombstone_for_glue (Slapi_PBlock *pb, char *sessionid, const Slapi_Entr + Slapi_PBlock *newpb; + const char *basedn = slapi_sdn_get_dn(parentdn); + char *conflict_csnstr = slapi_entry_attr_get_charptr(entry, "conflictcsn"); +- char *escaped_basedn = slapi_filter_escape_filter_value("nscpentrydn", basedn); ++ char *escaped_filter; ++ escaped_filter = slapi_filter_escape_filter_value("nscpentrydn", (char *)basedn); + CSN *conflict_csn = csn_new_by_string(conflict_csnstr); + slapi_ch_free_string(&conflict_csnstr); + CSN *tombstone_csn = NULL; +- char *filter = slapi_filter_sprintf("(&(objectclass=nstombstone)(nscpentrydn=%s))", escaped_basedn); +- slapi_ch_free((void **)&escaped_basedn); ++ char *filter = slapi_filter_sprintf("(&(objectclass=nstombstone)%s)", escaped_filter); ++ slapi_ch_free((void **)&escaped_filter); + newpb = slapi_pblock_new(); + char *parent_dn = slapi_dn_parent (basedn); + slapi_search_internal_set_pb(newpb, +-- +2.26.2 + diff --git a/SOURCES/0014-0002-Issue-4383-Do-not-normalize-escaped-spaces-in-a-DN.patch b/SOURCES/0014-0002-Issue-4383-Do-not-normalize-escaped-spaces-in-a-DN.patch new file mode 100644 index 0000000..a2dd067 --- /dev/null +++ b/SOURCES/0014-0002-Issue-4383-Do-not-normalize-escaped-spaces-in-a-DN.patch @@ -0,0 +1,48 @@ +From 1675ffa44180b53e70381e6d10b09a5c4e438780 Mon Sep 17 00:00:00 2001 +From: Mark Reynolds +Date: Wed, 11 Nov 2020 08:59:18 -0500 +Subject: [PATCH 2/2] Issue 4383 - Do not normalize escaped spaces in a DN + +Bug Description: Adding an entry with an escaped leading space leads to many + problems. Mainly id2entry can get corrupted during an + import of such an entry, and the entryrdn index is not + updated correctly + +Fix Description: In slapi_dn_normalize_ext() leave an escaped space intact. + +Relates: https://github.com/389ds/389-ds-base/issues/4383 + +Reviewed by: firstyear, progier, and tbordaz (Thanks!!!) +--- + ldap/servers/slapd/dn.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c +index 152561d33..965877850 100644 +--- a/ldap/servers/slapd/dn.c ++++ b/ldap/servers/slapd/dn.c +@@ -895,8 +895,7 @@ slapi_dn_normalize_ext(char *src, size_t src_len, char **dest, size_t *dest_len) + s++; + } + } +- } else if (s + 2 < ends && +- isxdigit(*(s + 1)) && isxdigit(*(s + 2))) { ++ } else if (s + 2 < ends && isxdigit(*(s + 1)) && isxdigit(*(s + 2))) { + /* esc hexpair ==> real character */ + int n = slapi_hexchar2int(*(s + 1)); + int n2 = slapi_hexchar2int(*(s + 2)); +@@ -904,6 +903,11 @@ slapi_dn_normalize_ext(char *src, size_t src_len, char **dest, size_t *dest_len) + if (n == 0) { /* don't change \00 */ + *d++ = *++s; + *d++ = *++s; ++ } else if (n == 32) { /* leave \20 (space) intact */ ++ *d++ = *s; ++ *d++ = *++s; ++ *d++ = *++s; ++ s++; + } else { + *d++ = n; + s += 3; +-- +2.26.2 + diff --git a/SPECS/389-ds-base.spec b/SPECS/389-ds-base.spec index 00c1577..866c711 100644 --- a/SPECS/389-ds-base.spec +++ b/SPECS/389-ds-base.spec @@ -39,7 +39,7 @@ Summary: 389 Directory Server (%{variant}) Name: 389-ds-base Version: 1.3.10.2 -Release: %{?relprefix}7%{?prerel}.1%{?dist} +Release: %{?relprefix}8%{?prerel}%{?dist} License: GPLv3+ URL: https://www.port389.org/ Group: System Environment/Daemons @@ -158,6 +158,8 @@ Patch09: 0009-Issue-4297-On-ADD-replication-URP-issue-internal-sea.patc Patch10: 0010-Issue-4379-allow-more-than-1-empty-AttributeDescript.patch Patch11: 0011-Issue-51233-ds-replcheck-crashes-in-offline-mode.patch Patch12: 0012-Issue-51166-Log-an-error-when-a-search-is-fully-unin.patch +Patch13: 0013-Issue-4297-2nd-fix-for-on-ADD-replication-URP-issue-.patch +Patch14: 0014-0002-Issue-4383-Do-not-normalize-escaped-spaces-in-a-DN.patch %description 389 Directory Server is an LDAPv3 compliant server. The base package includes @@ -511,6 +513,11 @@ fi %{_sysconfdir}/%{pkgname}/dirsrvtests %changelog +* Thu Dec 3 2020 Mark Reynolds - 1.3.10.2-8 +- Bump version to 1.3.10.2-8 +- Resolves: Bug 1904145 - group rdn with leading space char and add fails error 21 invalid syntax and delete fails error 32 +- Resolves: Bug 1902042 - Entries conflict not resolved by replication + * Wed Oct 21 2020 Mark Reynolds - 1.3.10.2-7 - Bump version to 1.3.10.2-7 - Resolves: Bug 1870624 - RHDS - allow more than 1 empty AttributeDescription for ldapsearch, without the risk of denial of service