zrhoffman / rpms / 389-ds-base

Forked from rpms/389-ds-base 3 years ago
Clone

Blame SOURCES/0080-Revert-Ticket-48338-SimplePagedResults-abandon-could.patch

400eba
From 45ea72050bfafa3dab744cec4338dd8ddca41a0c Mon Sep 17 00:00:00 2001
400eba
From: Noriko Hosoi <nhosoi@redhat.com>
400eba
Date: Thu, 7 Jan 2016 18:04:19 -0800
400eba
Subject: [PATCH 80/81] Revert "Ticket #48338 - SimplePagedResults -- abandon
400eba
 could happen between the abandon check and sending results"
400eba
400eba
This reverts commit 79ca67d1fc5d50d8a9ae6b686b9564f3960f8592.
400eba
400eba
The commit caused the bug 1296694 - ns-slapd crash in ipa context -
400eba
c_mutex lock memory corruption and self locks
400eba
400eba
(cherry picked from commit 181847863bda74c2e3d77b6a7d9278350d50d4cc)
400eba
(cherry picked from commit c8b1817896af7db6e4fab42734b827e002a7a25b)
400eba
---
400eba
 ldap/servers/slapd/pblock.c | 6 ++++--
400eba
 1 file changed, 4 insertions(+), 2 deletions(-)
400eba
400eba
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
400eba
index f2017be..bf57a33 100644
400eba
--- a/ldap/servers/slapd/pblock.c
400eba
+++ b/ldap/servers/slapd/pblock.c
400eba
@@ -223,12 +223,14 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
400eba
 			memset( value, 0, sizeof( PRNetAddr ));
400eba
 			break;
400eba
 		}
400eba
-		/* For fields with atomic access, remove the PR_Lock(c_mutex) */
400eba
+		PR_Lock( pblock->pb_conn->c_mutex );
400eba
 		if ( pblock->pb_conn->cin_addr == NULL ) {
400eba
 			memset( value, 0, sizeof( PRNetAddr ));
400eba
 		} else {
400eba
-			(*(PRNetAddr *)value) = *(pblock->pb_conn->cin_addr);
400eba
+			(*(PRNetAddr *)value) =
400eba
+			    *(pblock->pb_conn->cin_addr);
400eba
 		}
400eba
+		PR_Unlock( pblock->pb_conn->c_mutex );
400eba
 		break;
400eba
 	case SLAPI_CONN_SERVERNETADDR:
400eba
 		if (pblock->pb_conn == NULL)
400eba
-- 
400eba
2.4.3
400eba