zrhoffman / rpms / 389-ds-base

Forked from rpms/389-ds-base 3 years ago
Clone
Blob Blame History Raw
From 45ea72050bfafa3dab744cec4338dd8ddca41a0c Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Thu, 7 Jan 2016 18:04:19 -0800
Subject: [PATCH 80/81] 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)
---
 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 f2017be..bf57a33 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -223,12 +223,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