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

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