diff --git a/.389-ds-base.metadata b/.389-ds-base.metadata index 4f87bff..b3fb6c1 100644 --- a/.389-ds-base.metadata +++ b/.389-ds-base.metadata @@ -1,2 +1,2 @@ -e1146536caf20cdf178f8b9bca4f01be89dbcacb SOURCES/389-ds-base-2.4.5.tar.bz2 +274dec37976c1efde9cbeb458d50bbcd6b244974 SOURCES/389-ds-base-2.5.2.tar.bz2 1c8f2d0dfbf39fa8cd86363bf3314351ab21f8d4 SOURCES/jemalloc-5.3.0.tar.bz2 diff --git a/.gitignore b/.gitignore index 0bac1f7..b46948c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/389-ds-base-2.4.5.tar.bz2 +SOURCES/389-ds-base-2.5.2.tar.bz2 SOURCES/jemalloc-5.3.0.tar.bz2 diff --git a/SOURCES/0001-Issue-3527-Support-HAProxy-and-Instance-on-the-same-.patch b/SOURCES/0001-Issue-3527-Support-HAProxy-and-Instance-on-the-same-.patch deleted file mode 100644 index a8232ca..0000000 --- a/SOURCES/0001-Issue-3527-Support-HAProxy-and-Instance-on-the-same-.patch +++ /dev/null @@ -1,83 +0,0 @@ -From fcdeec3b876a28e06bb53a60fe502cb702403931 Mon Sep 17 00:00:00 2001 -From: Simon Pichugin -Date: Tue, 27 Feb 2024 16:30:47 -0800 -Subject: [PATCH] Issue 3527 - Support HAProxy and Instance on the same machine - configuration (#6107) - -Description: Improve how we handle HAProxy connections to work better when -the DS and HAProxy are on the same machine. -Ensure the client and header destination IPs are checked against the trusted IP list. - -Additionally, this change will also allow configuration having -HAProxy is listening on a different subnet than the one used to forward the request. - -Related: https://github.com/389ds/389-ds-base/issues/3527 - -Reviewed by: @progier389, @jchapma (Thanks!) ---- - ldap/servers/slapd/connection.c | 35 +++++++++++++++++++++++++-------- - 1 file changed, 27 insertions(+), 8 deletions(-) - -diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c -index a30511c97..07d629475 100644 ---- a/ldap/servers/slapd/connection.c -+++ b/ldap/servers/slapd/connection.c -@@ -1187,6 +1187,8 @@ connection_read_operation(Connection *conn, Operation *op, ber_tag_t *tag, int * - char str_ip[INET6_ADDRSTRLEN + 1] = {0}; - char str_haproxy_ip[INET6_ADDRSTRLEN + 1] = {0}; - char str_haproxy_destip[INET6_ADDRSTRLEN + 1] = {0}; -+ int trusted_matches_ip_found = 0; -+ int trusted_matches_destip_found = 0; - struct berval **bvals = NULL; - int proxy_connection = 0; - -@@ -1245,21 +1247,38 @@ connection_read_operation(Connection *conn, Operation *op, ber_tag_t *tag, int * - normalize_IPv4(conn->cin_addr, buf_ip, sizeof(buf_ip), str_ip, sizeof(str_ip)); - normalize_IPv4(&pr_netaddr_dest, buf_haproxy_destip, sizeof(buf_haproxy_destip), - str_haproxy_destip, sizeof(str_haproxy_destip)); -+ size_t ip_len = strlen(buf_ip); -+ size_t destip_len = strlen(buf_haproxy_destip); - - /* Now, reset RC and set it to 0 only if a match is found */ - haproxy_rc = -1; - -- /* Allow only: -- * Trusted IP == Original Client IP == HAProxy Header Destination IP */ -+ /* -+ * We need to allow a configuration where DS instance and HAProxy are on the same machine. -+ * In this case, we need to check if -+ * the HAProxy client IP (which will be a loopback address) matches one of the the trusted IP addresses, -+ * while still checking that -+ * the HAProxy header destination IP address matches one of the trusted IP addresses. -+ * Additionally, this change will also allow configuration having -+ * HAProxy listening on a different subnet than one used to forward the request. -+ */ - for (size_t i = 0; bvals[i] != NULL; ++i) { -- if ((strlen(bvals[i]->bv_val) == strlen(buf_ip)) && -- (strlen(bvals[i]->bv_val) == strlen(buf_haproxy_destip)) && -- (strncasecmp(bvals[i]->bv_val, buf_ip, strlen(buf_ip)) == 0) && -- (strncasecmp(bvals[i]->bv_val, buf_haproxy_destip, strlen(buf_haproxy_destip)) == 0)) { -- haproxy_rc = 0; -- break; -+ size_t bval_len = strlen(bvals[i]->bv_val); -+ -+ /* Check if the Client IP (HAProxy's machine IP) address matches the trusted IP address */ -+ if (!trusted_matches_ip_found) { -+ trusted_matches_ip_found = (bval_len == ip_len) && (strncasecmp(bvals[i]->bv_val, buf_ip, ip_len) == 0); -+ } -+ /* Check if the HAProxy header destination IP address matches the trusted IP address */ -+ if (!trusted_matches_destip_found) { -+ trusted_matches_destip_found = (bval_len == destip_len) && (strncasecmp(bvals[i]->bv_val, buf_haproxy_destip, destip_len) == 0); - } - } -+ -+ if (trusted_matches_ip_found && trusted_matches_destip_found) { -+ haproxy_rc = 0; -+ } -+ - if (haproxy_rc == -1) { - slapi_log_err(SLAPI_LOG_CONNS, "connection_read_operation", "HAProxy header received from unknown source.\n"); - disconnect_server_nomutex(conn, conn->c_connid, -1, SLAPD_DISCONNECT_PROXY_UNKNOWN, EPROTO); --- -2.43.0 - diff --git a/SOURCES/0001-Issue-6312-In-branch-2.5-healthcheck-report-an-inval.patch b/SOURCES/0001-Issue-6312-In-branch-2.5-healthcheck-report-an-inval.patch new file mode 100644 index 0000000..ff6da91 --- /dev/null +++ b/SOURCES/0001-Issue-6312-In-branch-2.5-healthcheck-report-an-inval.patch @@ -0,0 +1,60 @@ +From 0ff5aa641d619bdcc154c2c94f8f8180bcaec776 Mon Sep 17 00:00:00 2001 +From: tbordaz +Date: Thu, 29 Aug 2024 10:49:57 +0200 +Subject: [PATCH] Issue 6312 - In branch 2.5, healthcheck report an invalid + warning regarding BDB deprecation (#6313) + +Bug description: + during healthcheck, _lint_backend_implementation checks that + the instance is not running a BDB backend. + This check only applies for instance after 3.0.0 + +Fix description: + If the instance is newer than 3.0.0 the health check + just returns + +relates: #6312 + +Reviewed by: +--- + dirsrvtests/tests/suites/healthcheck/healthcheck_test.py | 1 + + src/lib389/lib389/backend.py | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/dirsrvtests/tests/suites/healthcheck/healthcheck_test.py b/dirsrvtests/tests/suites/healthcheck/healthcheck_test.py +index 29cca187e..66cf3c7d3 100644 +--- a/dirsrvtests/tests/suites/healthcheck/healthcheck_test.py ++++ b/dirsrvtests/tests/suites/healthcheck/healthcheck_test.py +@@ -556,6 +556,7 @@ def test_lint_backend_implementation_wrong_files(topology_st): + + + @pytest.mark.skipif(get_default_db_lib() == "mdb", reason="Not needed for mdb") ++@pytest.mark.skipif(ds_is_older("3.0.0"), reason="mdb and bdb are both supported") + def test_lint_backend_implementation(topology_st): + """Test the lint for backend implementation mismatch + +diff --git a/src/lib389/lib389/backend.py b/src/lib389/lib389/backend.py +index caee88e6a..0ed00a4a7 100644 +--- a/src/lib389/lib389/backend.py ++++ b/src/lib389/lib389/backend.py +@@ -14,7 +14,7 @@ from lib389._constants import DN_LDBM, DN_CHAIN, DN_PLUGIN, DEFAULT_BENAME + from lib389.properties import BACKEND_OBJECTCLASS_VALUE, BACKEND_PROPNAME_TO_ATTRNAME, BACKEND_CHAIN_BIND_DN, \ + BACKEND_CHAIN_BIND_PW, BACKEND_CHAIN_URLS, BACKEND_PROPNAME_TO_ATTRNAME, BACKEND_NAME, \ + BACKEND_SUFFIX, BACKEND_SAMPLE_ENTRIES, TASK_WAIT +-from lib389.utils import normalizeDN, ensure_str, assert_c ++from lib389.utils import normalizeDN, ensure_str, assert_c, ds_is_newer + from lib389 import Entry + + # Need to fix this .... +@@ -513,7 +513,7 @@ class Backend(DSLdapObject): + + def _lint_backend_implementation(self): + backend_impl = self._instance.get_db_lib() +- if backend_impl == 'bdb': ++ if backend_impl == 'bdb' and ds_is_newer('3.0.0', instance=self._instance): + result = DSBLE0006 + result['items'] = [self.lint_uid()] + yield result +-- +2.46.0 + diff --git a/SOURCES/0002-Issue-6112-RFE-add-new-operation-note-for-MFA-authen.patch b/SOURCES/0002-Issue-6112-RFE-add-new-operation-note-for-MFA-authen.patch deleted file mode 100644 index ad60607..0000000 --- a/SOURCES/0002-Issue-6112-RFE-add-new-operation-note-for-MFA-authen.patch +++ /dev/null @@ -1,237 +0,0 @@ -From 3cd7d30628007f839436c417af6dd8a056c6a165 Mon Sep 17 00:00:00 2001 -From: Mark Reynolds -Date: Fri, 1 Mar 2024 11:28:17 -0500 -Subject: [PATCH 2/3] Issue 6112 - RFE - add new operation note for MFA - authentications - -Add a new operation note to indicate that a MFA plugin performed the -BIND. This implies that the plugin must set the note itself as there is -no other way to detect this: - - slapi_pblock_set_flag_operation_notes(pb, SLAPI_OP_NOTE_MFA_AUTH); - -The purpose for this is for auditing needs - -Fixes: https://github.com/389ds/389-ds-base/issues/6112 - -Reviewed by: spichugi(Thanks!) ---- - ldap/admin/src/logconv.pl | 37 ++++++++++++++++++------------- - ldap/servers/slapd/log.c | 6 ++++- - ldap/servers/slapd/result.c | 2 +- - ldap/servers/slapd/slapi-plugin.h | 1 + - 4 files changed, 28 insertions(+), 18 deletions(-) - -diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl -index 5ba91e99c..10bd5d2aa 100755 ---- a/ldap/admin/src/logconv.pl -+++ b/ldap/admin/src/logconv.pl -@@ -2,11 +2,11 @@ - # - # BEGIN COPYRIGHT BLOCK - # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission. --# Copyright (C) 2022 Red Hat, Inc. -+# Copyright (C) 2010-2024 Red Hat, Inc. - # All rights reserved. - # - # License: GPL (version 3 or any later version). --# See LICENSE for details. -+# See LICENSE for details. - # END COPYRIGHT BLOCK - # - -@@ -218,6 +218,7 @@ my $sslClientFailedCount = 0; - my $objectclassTopCount= 0; - my $pagedSearchCount = 0; - my $invalidFilterCount = 0; -+my $mfaCount = 0; - my $bindCount = 0; - my $filterCount = 0; - my $baseCount = 0; -@@ -407,7 +408,7 @@ sub statusreport { - ########################################## - # # - # Parse Access Logs # --# # -+# # - ########################################## - - if ($files[$#files] =~ m/access.rotationinfo/) { -@@ -709,7 +710,7 @@ if($endTime){ - - # - # Get the start time in seconds --# -+# - my $logStart = $start; - my $startTotal = convertTimeToNanoseconds($logStart); - -@@ -890,6 +891,7 @@ $etimeAvg = $totalEtime / $etimeCount; - print sprintf "Average etime (elapsed time): %.9f\n", $etimeAvg; - - print "\n"; -+print "Multi-factor Authentications: $mfaCount\n"; - print "Proxied Auth Operations: $proxiedAuthCount\n"; - print "Persistent Searches: $persistentSrchCount\n"; - print "Internal Operations: $internalOpCount\n"; -@@ -1758,7 +1760,7 @@ if ($usage =~ /j/i || $verb eq "yes"){ - $recCount++; - } - if ($objectclassTopCount > ($srchCount *.25)){ -- print "\n $recCount. You have a high number of searches that query the entire search base. Although this is not necessarily bad, it could be resource intensive if the search base contains many entries.\n"; -+ print "\n $recCount. You have a high number of searches that query the entire search base. Although this is not necessarily bad, it could be resource intensive if the search base contains many entries.\n"; - $recCount++; - } - if ($recCount == 1){ -@@ -1792,7 +1794,7 @@ sub displayUsage { - - print " -h, --help help/usage\n"; - print " -d, --rootDN default is \"cn=directory manager\"\n"; -- print " -D, --data default is \"/tmp\"\n"; -+ print " -D, --data default is \"/tmp\"\n"; - print " -s, --sizeLimit default is 20\n"; - print " -X, --excludeIP E.g. Load balancers\n"; - print " -v, --version show version of tool\n"; -@@ -1800,8 +1802,8 @@ sub displayUsage { - print " E.g. \"[28/Mar/2002:13:14:22 -0800]\"\n"; - print " -E, --endTime