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

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