andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone

Blame SOURCES/0013-Issue-4797-ACL-IP-ADDRESS-evaluation-may-corrupt-c_i.patch

5d81fc
From bc41bbb89405b2059b80e344b2d4c59ae39aabe6 Mon Sep 17 00:00:00 2001
36233f
From: tbordaz <tbordaz@redhat.com>
36233f
Date: Thu, 10 Jun 2021 15:03:27 +0200
5d81fc
Subject: [PATCH 1/3] Issue 4797 - ACL IP ADDRESS evaluation may corrupt
36233f
 c_isreplication_session connection flags (#4799)
36233f
36233f
Bug description:
36233f
	The fix for ticket #3764 was broken with a missing break in a
36233f
	switch. The consequence is that while setting the client IP
36233f
	address in the pblock (SLAPI_CONN_CLIENTNETADDR_ACLIP), the
36233f
	connection is erroneously set as replication connection.
36233f
        This can lead to crash or failure of testcase
36233f
        test_access_from_certain_network_only_ip.
36233f
        This bug was quite hidden until the fix for #4764 is
36233f
        showing it more frequently
36233f
36233f
Fix description:
36233f
	Add the missing break
36233f
36233f
relates: https://github.com/389ds/389-ds-base/issues/4797
36233f
36233f
Reviewed by: Mark Reynolds
36233f
36233f
Platforms tested: F33
36233f
---
36233f
 ldap/servers/slapd/pblock.c | 3 ++-
36233f
 1 file changed, 2 insertions(+), 1 deletion(-)
36233f
36233f
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
5d81fc
index fcac53839..a64986aeb 100644
36233f
--- a/ldap/servers/slapd/pblock.c
36233f
+++ b/ldap/servers/slapd/pblock.c
5d81fc
@@ -2595,7 +2595,7 @@ slapi_pblock_set(Slapi_PBlock *pblock, int arg, void *value)
36233f
         pblock->pb_conn->c_authtype = slapi_ch_strdup((char *)value);
36233f
         pthread_mutex_unlock(&(pblock->pb_conn->c_mutex));
36233f
         break;
36233f
-	case SLAPI_CONN_CLIENTNETADDR_ACLIP:
36233f
+    case SLAPI_CONN_CLIENTNETADDR_ACLIP:
36233f
         if (pblock->pb_conn == NULL) {
36233f
             break;
36233f
         }
5d81fc
@@ -2603,6 +2603,7 @@ slapi_pblock_set(Slapi_PBlock *pblock, int arg, void *value)
36233f
         slapi_ch_free((void **)&pblock->pb_conn->cin_addr_aclip);
36233f
         pblock->pb_conn->cin_addr_aclip = (PRNetAddr *)value;
36233f
         pthread_mutex_unlock(&(pblock->pb_conn->c_mutex));
36233f
+        break;
36233f
     case SLAPI_CONN_IS_REPLICATION_SESSION:
36233f
         if (pblock->pb_conn == NULL) {
36233f
             slapi_log_err(SLAPI_LOG_ERR,
36233f
-- 
36233f
2.31.1
36233f