]> git.sur5r.net Git - openldap/blobdiff - contrib/slapd-modules/noopsrch/noopsrch.c
Happy New Year
[openldap] / contrib / slapd-modules / noopsrch / noopsrch.c
index f6d5256a42b85a580352b00754ded028da93d81b..d659f3097aac836980f56b1934219b1c8658c104 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2010-2011 The OpenLDAP Foundation.
+ * Copyright 2010-2013 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -199,7 +199,7 @@ noopsrch_db_init( BackendDB *be, ConfigReply *cr)
                int rc;
 
                rc = register_supported_control( LDAP_CONTROL_X_NOOPSRCH,
-                       SLAP_CTRL_SEARCH, NULL,
+                       SLAP_CTRL_SEARCH | SLAP_CTRL_GLOBAL_SEARCH, NULL,
                        noopsrch_parseCtrl, &noopsrch_cid );
                if ( rc != LDAP_SUCCESS ) {
                        Debug( LDAP_DEBUG_ANY,
@@ -219,12 +219,12 @@ noopsrch_db_destroy( BackendDB *be, ConfigReply *cr )
 
 #ifdef SLAP_CONFIG_DELETE
        overlay_unregister_control( be, LDAP_CONTROL_X_NOOPSRCH );
-#endif /* SLAP_CONFIG_DELETE */
-
        if ( --noopsrch_cnt == 0 ) {
                unregister_supported_control( LDAP_CONTROL_X_NOOPSRCH );
        }
 
+#endif /* SLAP_CONFIG_DELETE */
+
        return 0;
 }