cb_start.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. #include "cb.h"
  13. int
  14. chainingdb_start ( Slapi_PBlock *pb ) {
  15. cb_backend * cb;
  16. slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &cb );
  17. if (cb->started) {
  18. /* We may be called multiple times due to */
  19. /* plugin dependency resolution */
  20. return 0;
  21. }
  22. /*
  23. ** Reads in any configuration information held in the dse for the
  24. ** chaining plugin. Create dse entries used to configure the
  25. ** chaining plugin if they don't exist. Registers plugins to maintain
  26. ** those dse entries.
  27. */
  28. cb_config_load_dse_info(pb);
  29. /* Register new LDAPv3 controls supported by the chaining backend */
  30. slapi_register_supported_control( CB_LDAP_CONTROL_CHAIN_SERVER,
  31. SLAPI_OPERATION_SEARCH | SLAPI_OPERATION_COMPARE
  32. | SLAPI_OPERATION_ADD | SLAPI_OPERATION_DELETE
  33. | SLAPI_OPERATION_MODIFY | SLAPI_OPERATION_MODDN );
  34. /* register to be notified when backend state changes */
  35. slapi_register_backend_state_change((void *)cb_be_state_change,
  36. cb_be_state_change);
  37. cb->started=1;
  38. return 0;
  39. }