cb_start.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright 2001 Sun Microsystems, Inc.
  3. * Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
  4. * All rights reserved.
  5. * END COPYRIGHT BLOCK **/
  6. #include "cb.h"
  7. int
  8. chainingdb_start ( Slapi_PBlock *pb ) {
  9. cb_backend * cb;
  10. slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &cb );
  11. if (cb->started) {
  12. /* We may be called multiple times due to */
  13. /* plugin dependency resolution */
  14. return 0;
  15. }
  16. /*
  17. ** Reads in any configuration information held in the dse for the
  18. ** chaining plugin. Create dse entries used to configure the
  19. ** chaining plugin if they don't exist. Registers plugins to maintain
  20. ** those dse entries.
  21. */
  22. cb_config_load_dse_info(pb);
  23. /* Register new LDAPv3 controls supported by the chaining backend */
  24. slapi_register_supported_control( CB_LDAP_CONTROL_CHAIN_SERVER,
  25. SLAPI_OPERATION_SEARCH | SLAPI_OPERATION_COMPARE
  26. | SLAPI_OPERATION_ADD | SLAPI_OPERATION_DELETE
  27. | SLAPI_OPERATION_MODIFY | SLAPI_OPERATION_MODDN );
  28. /* register to be notified when backend state changes */
  29. slapi_register_backend_state_change((void *)cb_be_state_change,
  30. cb_be_state_change);
  31. cb->started=1;
  32. return 0;
  33. }