]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Revert "ITS#9045 Do not share cn=config entries with outside code"
authorQuanah Gibson-Mount <quanah@openldap.org>
Wed, 2 Nov 2022 17:55:29 +0000 (17:55 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 2 Nov 2022 17:55:29 +0000 (17:55 +0000)
This reverts commit ce7a7997833326e3a9fb363b7fb10afe02b7d192.

servers/slapd/bconfig.c

index 4e00802723f5f5573a3b467aef1f91908b4f1dfd..c5c69bab564143509203587cef9d4f3463971e5d 100644 (file)
@@ -6941,6 +6941,7 @@ out:
        return rs->sr_err;
 }
 
+/* no-op, we never free entries */
 int config_entry_release(
        Operation *op,
        Entry *e,
@@ -6960,8 +6961,6 @@ int config_entry_release(
                } else {
                        entry_free( e );
                }
-       } else {
-               entry_free( e );
        }
        return rc;
 }
@@ -6978,31 +6977,21 @@ int config_back_entry_get(
 {
        CfBackInfo *cfb;
        CfEntryInfo *ce, *last;
-       Entry *e = NULL;
-       int locked = 0, rc = LDAP_NO_SUCH_OBJECT;
+       int rc = LDAP_NO_SUCH_OBJECT;
 
        cfb = (CfBackInfo *)op->o_bd->be_private;
 
-       if ( !ldap_pvt_thread_pool_pausequery( &connection_pool ) ) {
-               ldap_pvt_thread_rdwr_rlock( &cfb->cb_rwlock );
-               locked = 1;
-       }
        ce = config_find_base( cfb->cb_root, ndn, &last );
        if ( ce ) {
-               e = ce->ce_entry;
-               if ( e ) {
+               *ent = ce->ce_entry;
+               if ( *ent ) {
                        rc = LDAP_SUCCESS;
-                       if ( oc && !is_entry_objectclass_or_sub( e, oc ) ) {
+                       if ( oc && !is_entry_objectclass_or_sub( *ent, oc ) ) {
                                rc = LDAP_NO_SUCH_ATTRIBUTE;
-                               e = NULL;
+                               *ent = NULL;
                        }
                }
        }
-       if ( e ) {
-               *ent = entry_dup( e );
-       }
-       if ( locked )
-               ldap_pvt_thread_rdwr_runlock( &cfb->cb_rwlock );
 
        return rc;
 }