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

36233f
From a789f89dbf84dd5f6395198bf5cc4db88453ec4b Mon Sep 17 00:00:00 2001
36233f
From: tbordaz <tbordaz@redhat.com>
36233f
Date: Thu, 10 Jun 2021 15:03:27 +0200
36233f
Subject: [PATCH] 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
36233f
index 1ad9d0399..9fd599bcb 100644
36233f
--- a/ldap/servers/slapd/pblock.c
36233f
+++ b/ldap/servers/slapd/pblock.c
36233f
@@ -2589,7 +2589,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
         }
36233f
@@ -2597,6 +2597,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