ldap/servers/slapd/back-ldbm/ldbm_search.c | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit 0232f37a14bfff6e9865fb4d121bbcdf249e1834
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Fri Apr 4 13:16:27 2014 -0400
Ticket 47766 - Tombstone purging can crash the server if the backend is
stopped/disabled
Bug Description: The tombstone purge thread issues a callback search that will start
reading id2entry, even if the backend is stopped. This can crash
the
server.
Fix Description: When performing a search and returning entries, check if the
backend
is started before reading id2entry.
https://fedorahosted.org/389/ticket/47766
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 559d70e0a1e3df75a66e41fd1c009b25ca6f6a08)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c
b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index d092b2e..552b65b 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -1487,6 +1487,16 @@ ldbm_back_next_search_entry_ext( Slapi_PBlock *pb, int
use_extension )
++sr->sr_lookthroughcount; /* checked above */
+ /* Make sure the backend is available */
+ if( be->be_state != BE_STATE_STARTED ){
+ slapi_send_ldap_result( pb, LDAP_UNWILLING_TO_PERFORM, NULL,
+ "Backend is stopped", 0, NULL );
+ slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_ENTRY, NULL );
+ delete_search_result_set(pb, &sr);
+ rc = SLAPI_FAIL_GENERAL;
+ goto bail;
+ }
+
/* get the entry */
e = id2entry( be, id, &txn, &err );
if ( e == NULL )