andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From 9b6178ab7776885a73f76faf1e070086f07283d9 Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Thu, 7 Jan 2016 18:04:19 -0800
Subject: [PATCH 372/375] Revert "Ticket #48338 - SimplePagedResults -- abandon
 could happen between the abandon check and sending results"

This reverts commit 79ca67d1fc5d50d8a9ae6b686b9564f3960f8592.

The commit caused the bug 1296694 - ns-slapd crash in ipa context -
c_mutex lock memory corruption and self locks

(cherry picked from commit 181847863bda74c2e3d77b6a7d9278350d50d4cc)
(cherry picked from commit c8b1817896af7db6e4fab42734b827e002a7a25b)
(cherry picked from commit 61c3ff6ae654f9e0617741ee504f382fe78ee452)
(cherry picked from commit bab6ec6554b6f9da5dd734b1dcf5de2a382edfa8)
---
 ldap/servers/slapd/pblock.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index 4e57fc3..b12881b 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -251,12 +251,14 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
 			memset( value, 0, sizeof( PRNetAddr ));
 			break;
 		}
-		/* For fields with atomic access, remove the PR_Lock(c_mutex) */
+		PR_Lock( pblock->pb_conn->c_mutex );
 		if ( pblock->pb_conn->cin_addr == NULL ) {
 			memset( value, 0, sizeof( PRNetAddr ));
 		} else {
-			(*(PRNetAddr *)value) = *(pblock->pb_conn->cin_addr);
+			(*(PRNetAddr *)value) =
+			    *(pblock->pb_conn->cin_addr);
 		}
+		PR_Unlock( pblock->pb_conn->c_mutex );
 		break;
 	case SLAPI_CONN_SERVERNETADDR:
 		if (pblock->pb_conn == NULL)
-- 
2.4.3