]> git.sur5r.net Git - openldap/commitdiff
ITS#3365 - fix leaking bdb locks when evaluating dynamic groups
authorHoward Chu <hyc@openldap.org>
Wed, 27 Oct 2004 14:52:18 +0000 (14:52 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 27 Oct 2004 14:52:18 +0000 (14:52 +0000)
servers/slapd/backend.c

index 4c1d58a1be798124732d0e880fb9d9e766896890..834b99dae1d50cfab602ca9e9d6eb2ad39d52f38 100644 (file)
@@ -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;