apr_ldap_rebind.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * The APR LDAP rebind functions provide an implementation of
  18. * a rebind procedure that can be used to allow clients to chase referrals,
  19. * using the same credentials used to log in originally.
  20. *
  21. * Use of this implementation is optional.
  22. *
  23. * @file apr_ldap_rebind.h
  24. * @brief Apache LDAP library
  25. */
  26. #ifndef APU_LDAP_REBIND_H
  27. #define APU_LDAP_REBIND_H
  28. /**
  29. * @addtogroup APR_Util_LDAP
  30. * @{
  31. **/
  32. #if defined(DOXYGEN)
  33. #include "apr_ldap.h"
  34. #endif
  35. /*
  36. * Handle the case when LDAP is enabled
  37. */
  38. #if APR_HAS_LDAP
  39. /**
  40. * APR LDAP initialize rebind lock
  41. *
  42. * This function creates the lock for controlling access to the xref list..
  43. * @param pool Pool to use when creating the xref_lock.
  44. */
  45. APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_init(apr_pool_t *pool);
  46. /**
  47. * APR LDAP rebind_add function
  48. *
  49. * This function creates a cross reference entry for the specified ldap
  50. * connection. The rebind callback function will look up this ldap
  51. * connection so it can retrieve the bindDN and bindPW for use in any
  52. * binds while referrals are being chased.
  53. *
  54. * This function will add the callback to the LDAP handle passed in.
  55. *
  56. * A cleanup is registered within the pool provided to remove this
  57. * entry when the pool is removed. Alternatively apr_ldap_rebind_remove()
  58. * can be called to explicitly remove the entry at will.
  59. *
  60. * @param pool The pool to use
  61. * @param ld The LDAP connectionhandle
  62. * @param bindDN The bind DN to be used for any binds while chasing
  63. * referrals on this ldap connection.
  64. * @param bindPW The bind Password to be used for any binds while
  65. * chasing referrals on this ldap connection.
  66. */
  67. APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_add(apr_pool_t *pool,
  68. LDAP *ld,
  69. const char *bindDN,
  70. const char *bindPW);
  71. /**
  72. * APR LDAP rebind_remove function
  73. *
  74. * This function removes the rebind cross reference entry for the
  75. * specified ldap connection.
  76. *
  77. * If not explicitly removed, this function will be called automatically
  78. * when the pool is cleaned up.
  79. *
  80. * @param ld The LDAP connectionhandle
  81. */
  82. APU_DECLARE_LDAP(apr_status_t) apr_ldap_rebind_remove(LDAP *ld);
  83. #endif /* APR_HAS_LDAP */
  84. /** @} */
  85. #endif /* APU_LDAP_REBIND_H */