From 0c9c90a3e96d41f3079feecaceade7cda0b867a8 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 27 Oct 2004 14:52:18 +0000 Subject: [PATCH] ITS#3365 - fix leaking bdb locks when evaluating dynamic groups --- servers/slapd/backend.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 4c1d58a1be..834b99dae1 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -1329,10 +1329,15 @@ backend_group( Filter *filter; Entry *user; Backend *b2 = op->o_bd; + void *o_private = op->o_private; if ( target && dn_match( &target->e_nname, op_ndn ) ) { user = target; } else { + /* back-bdb stored lockinfo here, we saved it + * above. Clear it out so that a new lock can be used. + */ + op->o_private = NULL; op->o_bd = select_backend( op_ndn, 0, 0 ); rc = be_entry_get_rw(op, op_ndn, NULL, NULL, 0, &user ); } @@ -1397,6 +1402,8 @@ loopit: } if ( user != target ) { be_entry_release_r( op, user ); + /* restore previous lockinfo, if any */ + op->o_private = o_private; } } op->o_bd = b2; -- 2.39.5