Commit 9cf2757f authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

Revert r1140069:

    Fix load order dependencies in LDAP code by switching to use of APR
    optional functions for the inter-module API...



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/revert-ap-ldap@1150164 13f79535-47bb-0310-9956-ffa450edef68
parent 4ea8df56
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -30,7 +30,26 @@
 * @{
 */

#include "apr_optional.h"
/* Create a set of LDAP_DECLARE macros with appropriate export 
 * and import tags for the platform
 */
#if !defined(WIN32)
#define LDAP_DECLARE(type)            type
#define LDAP_DECLARE_NONSTD(type)     type
#define LDAP_DECLARE_DATA
#elif defined(LDAP_DECLARE_STATIC)
#define LDAP_DECLARE(type)            type __stdcall
#define LDAP_DECLARE_NONSTD(type)     type
#define LDAP_DECLARE_DATA
#elif defined(LDAP_DECLARE_EXPORT)
#define LDAP_DECLARE(type)            __declspec(dllexport) type __stdcall
#define LDAP_DECLARE_NONSTD(type)     __declspec(dllexport) type
#define LDAP_DECLARE_DATA             __declspec(dllexport)
#else
#define LDAP_DECLARE(type)            __declspec(dllimport) type __stdcall
#define LDAP_DECLARE_NONSTD(type)     __declspec(dllimport) type
#define LDAP_DECLARE_DATA             __declspec(dllimport)
#endif

/* identify the LDAP toolkit used */
#define AP_HAS_NETSCAPE_LDAPSDK  @ap_has_ldap_netscape@
+20 −1
Original line number Diff line number Diff line
@@ -30,7 +30,26 @@
 * @{
 */

#include "apr_optional.h"
/* Create a set of LDAP_DECLARE macros with appropriate export 
 * and import tags for the platform
 */
#if !defined(WIN32)
#define LDAP_DECLARE(type)            type
#define LDAP_DECLARE_NONSTD(type)     type
#define LDAP_DECLARE_DATA
#elif defined(LDAP_DECLARE_STATIC)
#define LDAP_DECLARE(type)            type __stdcall
#define LDAP_DECLARE_NONSTD(type)     type
#define LDAP_DECLARE_DATA
#elif defined(LDAP_DECLARE_EXPORT)
#define LDAP_DECLARE(type)            __declspec(dllexport) type __stdcall
#define LDAP_DECLARE_NONSTD(type)     __declspec(dllexport) type
#define LDAP_DECLARE_DATA             __declspec(dllexport)
#else
#define LDAP_DECLARE(type)            __declspec(dllimport) type __stdcall
#define LDAP_DECLARE_NONSTD(type)     __declspec(dllimport) type
#define LDAP_DECLARE_DATA             __declspec(dllimport)
#endif

/* this will be defined if LDAP support was compiled into apr-util */
#define AP_HAS_LDAP		   1
+13 −15
Original line number Diff line number Diff line
@@ -86,12 +86,10 @@ extern "C" {
 * ap_ldap_set_option() AP_LDAP_OPT_TLS_CERT option for details.
 * @param result_err The returned result
 */
APR_DECLARE_OPTIONAL_FN(int, ap_ldap_ssl_init, 
                        (apr_pool_t *pool,
LDAP_DECLARE(int) ap_ldap_ssl_init(apr_pool_t *pool,
                                      const char *cert_auth_file,
                                      int cert_file_type,
                         ap_ldap_err_t **result_err));

                                      ap_ldap_err_t **result_err);

/**
 * LDAP SSL De-Initialise function
@@ -102,7 +100,7 @@ APR_DECLARE_OPTIONAL_FN(int, ap_ldap_ssl_init,
 * @todo currently we do not check whether ap_ldap_ssl_init()
 * has been called first - we probably should.
 */
APR_DECLARE_OPTIONAL_FN(int, ap_ldap_ssl_deinit, (void));
LDAP_DECLARE(int) ap_ldap_ssl_deinit(void);

/**
 * LDAP initialise function
@@ -138,12 +136,12 @@ APR_DECLARE_OPTIONAL_FN(int, ap_ldap_ssl_deinit, (void));
 * @param secure The security mode to set
 * @param result_err The returned result
 */
APR_DECLARE_OPTIONAL_FN(int, ap_ldap_init, (apr_pool_t *pool, 
LDAP_DECLARE(int) ap_ldap_init(apr_pool_t *pool,
                                  LDAP **ldap,
                                  const char *hostname,
                                  int portno,
                                  int secure,
                                            ap_ldap_err_t **result_err));
                                  ap_ldap_err_t **result_err);

/**
 * LDAP info function
@@ -153,8 +151,8 @@ APR_DECLARE_OPTIONAL_FN(int, ap_ldap_init, (apr_pool_t *pool,
 * @param pool The pool to use
 * @param result_err The returned result
 */
APR_DECLARE_OPTIONAL_FN(int, ap_ldap_info, (apr_pool_t *pool,
                                            ap_ldap_err_t **result_err));
LDAP_DECLARE(int) ap_ldap_info(apr_pool_t *pool,
                                  ap_ldap_err_t **result_err);

#ifdef __cplusplus
}
+10 −10
Original line number Diff line number Diff line
@@ -214,11 +214,11 @@ struct ap_ldap_opt_tls_cert_t {
 * @param result_err The ap_ldap_err_t structure contained detailed results
 *        of the operation.
 */
APR_DECLARE_OPTIONAL_FN(int, ap_ldap_get_option, (apr_pool_t *pool,
LDAP_DECLARE(int) ap_ldap_get_option(apr_pool_t *pool,
                                        LDAP *ldap,
                                        int option,
                                        void *outvalue,
                                                  ap_ldap_err_t **result_err));
                                        ap_ldap_err_t **result_err);

/**
 * LDAP set option function
@@ -236,11 +236,11 @@ APR_DECLARE_OPTIONAL_FN(int, ap_ldap_get_option, (apr_pool_t *pool,
 * @param result_err The ap_ldap_err_t structure contained detailed results
 *        of the operation.
 */
APR_DECLARE_OPTIONAL_FN(int, ap_ldap_set_option, (apr_pool_t *pool,
LDAP_DECLARE(int) ap_ldap_set_option(apr_pool_t *pool,
                                        LDAP *ldap,
                                        int option,
                                        const void *invalue,
                                                  ap_ldap_err_t **result_err));
                                        ap_ldap_err_t **result_err);

#ifdef __cplusplus
}
+6 −6
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
 * This function creates the lock for controlling access to the xref list..
 * @param pool Pool to use when creating the xref_lock.
 */
APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_ldap_rebind_init, (apr_pool_t *pool));
LDAP_DECLARE(apr_status_t) ap_ldap_rebind_init(apr_pool_t *pool);


/**
@@ -72,10 +72,10 @@ APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_ldap_rebind_init, (apr_pool_t *pool));
 * @param bindPW The bind Password to be used for any binds while 
 *               chasing referrals on this ldap connection.
 */
APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_ldap_rebind_add, (apr_pool_t *pool,
LDAP_DECLARE(apr_status_t) ap_ldap_rebind_add(apr_pool_t *pool,
                                                 LDAP *ld,
                                                 const char *bindDN,
                                                           const char *bindPW));
                                                 const char *bindPW);

/**
 * LDAP rebind_remove function
@@ -88,7 +88,7 @@ APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_ldap_rebind_add, (apr_pool_t *pool,
 *
 * @param ld The LDAP connectionhandle
 */
APR_DECLARE_OPTIONAL_FN(apr_status_t, ap_ldap_rebind_remove, (LDAP *ld));
LDAP_DECLARE(apr_status_t) ap_ldap_rebind_remove(LDAP *ld);

#endif /* AP_HAS_LDAP */

Loading