You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bn...@apache.org on 2003/02/14 17:07:20 UTC
cvs commit: apr-util/include apr_ldap.hw apr_ldap.hnw apr_ldap.h.in
bnicholes 2003/02/14 08:07:19
Modified: include apr_ldap.hw apr_ldap.hnw apr_ldap.h.in
Log:
Added support for Novell LDAP SDK and standardized the SSL support across
the various LDAP SDKs. Isolated the SSL functionality to mod_ldap rather than
speading it across mod_auth_ldap and mod_ldap.
Submitted by: Dave Ward, Brad Nicholes (bnicholes@apache.org)
Revision Changes Path
1.6 +69 -28 apr-util/include/apr_ldap.hw
Index: apr_ldap.hw
===================================================================
RCS file: /home/cvs/apr-util/include/apr_ldap.hw,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- apr_ldap.hw 1 Jan 2003 00:02:20 -0000 1.5
+++ apr_ldap.hw 14 Feb 2003 16:07:18 -0000 1.6
@@ -82,18 +82,49 @@
/* this whole thing disappears if LDAP is not enabled */
#if !APR_HAS_LDAP
+#define APR_HAS_NETSCAPE_LDAPSDK 0
+#define APR_HAS_NOVELL_LDAPSDK 0
+#define APR_HAS_OPENLDAP_LDAPSDK 0
+#define APR_HAS_MICROSOFT_LDAPSDK 0
+#define APR_HAS_OTHER_LDAPSDK 0
+
+#define APR_HAS_LDAP_SSL 0
#define APR_HAS_LDAP_URL_PARSE 0
-#define APU_HAS_LDAP_NETSCAPE_SSL 0
-#define APU_HAS_LDAP_STARTTLS 0
-#else
-/* presume all unices do, win32, for example, does not */
-#define APR_HAS_LDAP_URL_PARSE 0
+#else /* ldap support available */
+
-/* LDAP secure capabilities */
-#define APR_HAS_LDAP_NETSCAPE_SSL 0
-#define APR_HAS_LDAP_STARTTLS 0
+ /* There a several LDAPv3 SDKs available on various platforms
+ * define which LDAP SDK is used
+ */
+#define APR_HAS_NETSCAPE_LDAPSDK 0
+#define APR_HAS_NOVELL_LDAPSDK 0
+#define APR_HAS_OPENLDAP_LDAPSDK 0
+#define APR_HAS_MICROSOFT_LDAPSDK 1
+#define APR_HAS_OTHER_LDAPSDK 0
+
+ /* define if LDAP SSL support is available
+ */
+#define APR_HAS_LDAP_SSL 1
+
+ /* If no APR_HAS_xxx_LDAPSDK is defined error out
+ * Define if the SDK supports the ldap_url_parse function
+ */
+#if APR_HAS_NETSCAPE_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 1
+#elif APR_HAS_NOVELL_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 1
+#elif APR_HAS_OPENLDAP_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 1
+#elif APR_HAS_MICROSOFT_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 0
+#elif APR_HAS_OTHER_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 0
+#else
+ #define APR_HAS_LDAP_URL_PARSE 0
+ #error "ERROR no LDAP SDK defined!"
+#endif
/* These are garbage, our public macros are always APR_HAS_ prefixed,
* and use 0/1 values, not defined/undef semantics.
@@ -104,39 +135,49 @@
#define APU_HAS_LDAP
#endif
-#if APR_HAS_LDAP_NETSCAPE_SSL
-#define APU_HAS_LDAP_NETSCAPE_SSL
+
+/* LDAP header files */
+
+#if APR_HAS_NETSCAPE_LDAPSDK
+#include <ldap.h>
+#include <lber.h>
+#if APR_HAS_LDAP_SSL
+#include <ldap_ssl.h>
+#endif
+#endif
+
+#if APR_HAS_NOVELL_LDAPSDK
+#include <ldap.h>
+#include <lber.h>
+#if APR_HAS_LDAP_SSL
+#include <ldap_ssl.h>
+#endif
#endif
-#if APR_HAS_LDAP_STARTTLS
-#define APU_HAS_LDAP_STARTTLS
+#if APR_HAS_OPENLDAP_LDAPSDK
+#include <ldap.h>
+#include <lber.h>
#endif
/* Included in Windows 2000 and later, earlier 9x/NT 4.0 clients
* will need to obtain the Active Directory Client Extensions.
*/
-#include <Winldap.h>
+#if APR_HAS_MICROSOFT_LDAPSDK
+#include <winldap.h>
+#define LDAPS_PORT LDAP_SSL_PORT
+#endif
-/*
- * LDAP Compatibility
- */
-/* These don't apply on Win32, leave them in place for reference
+/* LDAPv2 SDKs don't use const parameters in their prototypes.
+ * LDAPv3 SDKs do use const. When compiling with LDAPv2 SDKs, const_cast
+ * casts away the constness, but won't under LDAPv3
*/
#if LDAP_VERSION_MAX <= 2
-int ldap_search_ext_s(LDAP *ldap, char *base, int scope, char *filter,
- char **attrs, int attrsonly, void *servertrls, void *clientctrls,
- void *timeout, int sizelimit, LDAPMessage **res);
-void ldap_memfree(void *p);
-
-/* The const_cast is used to get around the fact that some of the LDAPv2 prototypes
- * have non-const parameters, while the same ones in LDAPv3 are const. If compiling
- * with LDAPv2, the const_cast casts away the constness, but won't under LDAPv3
- */
#define const_cast(x) ((char *)(x))
#else
#define const_cast(x) (x)
-#endif /* LDAP_VERSION_MAX */
+#endif
+
#include "apr_ldap_url.h"
@@ -150,5 +191,5 @@
#endif
/** @} */
-#endif /* APU_HAS_LDAP */
+#endif /* APR_HAS_LDAP */
#endif /* APU_LDAP_H */
1.6 +72 -31 apr-util/include/apr_ldap.hnw
Index: apr_ldap.hnw
===================================================================
RCS file: /home/cvs/apr-util/include/apr_ldap.hnw,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- apr_ldap.hnw 1 Jan 2003 00:02:20 -0000 1.5
+++ apr_ldap.hnw 14 Feb 2003 16:07:19 -0000 1.6
@@ -79,18 +79,49 @@
/* this whole thing disappears if LDAP is not enabled */
#if !APR_HAS_LDAP
-#define APR_HAS_LDAP_URL_PARSE 0
-#define APU_HAS_LDAP_NETSCAPE_SSL 0
-#define APU_HAS_LDAP_STARTTLS 0
-
-#else
-
-/* presume all unices do, win32, for example, does not */
-#define APR_HAS_LDAP_URL_PARSE 1
-
-/* LDAP secure capabilities */
-#define APR_HAS_LDAP_NETSCAPE_SSL 0
-#define APR_HAS_LDAP_STARTTLS 0
+#define APR_HAS_NETSCAPE_LDAPSDK 0
+#define APR_HAS_NOVELL_LDAPSDK 0
+#define APR_HAS_OPENLDAP_LDAPSDK 0
+#define APR_HAS_MICROSOFT_LDAPSDK 0
+#define APR_HAS_OTHER_LDAPSDK 0
+
+#define APR_HAS_LDAP_SSL 0
+#define APR_HAS_LDAP_URL_PARSE 0
+
+
+#else /* ldap support available */
+
+
+ /* There a several LDAPv3 SDKs available on various platforms
+ * define which LDAP SDK is used
+ */
+#define APR_HAS_NETSCAPE_LDAPSDK 0
+#define APR_HAS_NOVELL_LDAPSDK 1
+#define APR_HAS_OPENLDAP_LDAPSDK 0
+#define APR_HAS_MICROSOFT_LDAPSDK 0
+#define APR_HAS_OTHER_LDAPSDK 0
+
+ /* define if LDAP SSL support is available
+ */
+#define APR_HAS_LDAP_SSL 1
+
+ /* If no APR_HAS_xxx_LDAPSDK is defined error out
+ * Define if the SDK supports the ldap_url_parse function
+ */
+#if APR_HAS_NETSCAPE_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 1
+#elif APR_HAS_NOVELL_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 1
+#elif APR_HAS_OPENLDAP_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 1
+#elif APR_HAS_MICROSOFT_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 0
+#elif APR_HAS_OTHER_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 0
+#else
+ #define APR_HAS_LDAP_URL_PARSE 0
+ #error "ERROR no LDAP SDK defined!"
+#endif
/* These are garbage, our public macros are always APR_HAS_ prefixed,
* and use 0/1 values, not defined/undef semantics.
@@ -101,39 +132,49 @@
#define APU_HAS_LDAP
#endif
-#if APR_HAS_LDAP_NETSCAPE_SSL
-#define APU_HAS_LDAP_NETSCAPE_SSL
-#endif
-#if APR_HAS_LDAP_STARTTLS
-#define APU_HAS_LDAP_STARTTLS
-#endif
+/* LDAP header files */
+#if APR_HAS_NETSCAPE_LDAPSDK
+#include <ldap.h>
+#include <lber.h>
+#if APR_HAS_LDAP_SSL
+#include <ldap_ssl.h>
+#endif
+#endif
-/* LDAP header files */
+#if APR_HAS_NOVELL_LDAPSDK
#include <ldap.h>
#include <lber.h>
+#if APR_HAS_LDAP_SSL
#include <ldap_ssl.h>
+#endif
+#endif
+#if APR_HAS_OPENLDAP_LDAPSDK
+#include <ldap.h>
+#include <lber.h>
+#endif
-/*
- * LDAP Compatibility
+/* Included in Windows 2000 and later, earlier 9x/NT 4.0 clients
+ * will need to obtain the Active Directory Client Extensions.
*/
+#if APR_HAS_MICROSOFT_LDAPSDK
+#include <winldap.h>
+#define LDAPS_PORT LDAP_SSL_PORT
+#endif
-#if LDAP_VERSION_MAX <= 2
-int ldap_search_ext_s(LDAP *ldap, char *base, int scope, char *filter,
- char **attrs, int attrsonly, void *servertrls, void *clientctrls,
- void *timeout, int sizelimit, LDAPMessage **res);
-void ldap_memfree(void *p);
-
-/* The const_cast is used to get around the fact that some of the LDAPv2 prototypes
- * have non-const parameters, while the same ones in LDAPv3 are const. If compiling
- * with LDAPv2, the const_cast casts away the constness, but won't under LDAPv3
+
+/* LDAPv2 SDKs don't use const parameters in their prototypes.
+ * LDAPv3 SDKs do use const. When compiling with LDAPv2 SDKs, const_cast
+ * casts away the constness, but won't under LDAPv3
*/
+#if LDAP_VERSION_MAX <= 2
#define const_cast(x) ((char *)(x))
#else
#define const_cast(x) (x)
-#endif /* LDAP_VERSION_MAX */
+#endif
+
#include "apr_ldap_url.h"
1.7 +59 -28 apr-util/include/apr_ldap.h.in
Index: apr_ldap.h.in
===================================================================
RCS file: /home/cvs/apr-util/include/apr_ldap.h.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- apr_ldap.h.in 1 Jan 2003 00:02:20 -0000 1.6
+++ apr_ldap.h.in 14 Feb 2003 16:07:19 -0000 1.7
@@ -79,18 +79,49 @@
/* this whole thing disappears if LDAP is not enabled */
#if !APR_HAS_LDAP
+#define APR_HAS_NETSCAPE_LDAPSDK 0
+#define APR_HAS_NOVELL_LDAPSDK 0
+#define APR_HAS_OPENLDAP_LDAPSDK 0
+#define APR_HAS_MICROSOFT_LDAPSDK 0
+#define APR_HAS_OTHER_LDAPSDK 0
+
+#define APR_HAS_LDAP_SSL 0
#define APR_HAS_LDAP_URL_PARSE 0
-#define APU_HAS_LDAP_NETSCAPE_SSL 0
-#define APU_HAS_LDAP_STARTTLS 0
-#else
-/* presume all unices do, win32, for example, does not */
-#define APR_HAS_LDAP_URL_PARSE 1
+#else /* ldap support available */
+
-/* LDAP secure capabilities */
-#define APR_HAS_LDAP_NETSCAPE_SSL @apu_has_ldap_netscape_ssl@
-#define APR_HAS_LDAP_STARTTLS @apu_has_ldap_starttls@
+ /* There a several LDAPv3 SDKs available on various platforms
+ * define which LDAP SDK is used
+ */
+#define APR_HAS_NETSCAPE_LDAPSDK @apu_has_ldap_netscape@
+#define APR_HAS_NOVELL_LDAPSDK @apu_has_ldap_novell@
+#define APR_HAS_OPENLDAP_LDAPSDK @apu_has_ldap_openldap@
+#define APR_HAS_MICROSOFT_LDAPSDK @apu_has_ldap_microsoft@
+#define APR_HAS_OTHER_LDAPSDK @apu_has_ldap_other@
+
+ /* define if LDAP SSL support is available
+ */
+#define APR_HAS_LDAP_SSL @apu_has_ldap_ssl@
+
+ /* If no APR_HAS_xxx_LDAPSDK is defined error out
+ * Define if the SDK supports the ldap_url_parse function
+ */
+#if APR_HAS_NETSCAPE_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 1
+#elif APR_HAS_NOVELL_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 1
+#elif APR_HAS_OPENLDAP_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 1
+#elif APR_HAS_MICROSOFT_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 0
+#elif APR_HAS_OTHER_LDAPSDK
+ #define APR_HAS_LDAP_URL_PARSE 0
+#else
+ #define APR_HAS_LDAP_URL_PARSE 0
+ #error "ERROR no LDAP SDK defined!"
+#endif
/* These are garbage, our public macros are always APR_HAS_ prefixed,
* and use 0/1 values, not defined/undef semantics.
@@ -101,38 +132,38 @@
#define APU_HAS_LDAP
#endif
-#if APR_HAS_LDAP_NETSCAPE_SSL
-#define APU_HAS_LDAP_NETSCAPE_SSL
-#endif
+/* LDAP header files */
-#if APR_HAS_LDAP_STARTTLS
-#define APU_HAS_LDAP_STARTTLS
+#if APR_HAS_NETSCAPE_LDAPSDK
+@ldap_h@
+@lber_h@
+#if APR_HAS_LDAP_SSL
+@ldap_ssl_h@
+#endif
#endif
-/* LDAP header files */
+#if APR_HAS_NOVELL_LDAPSDK
@ldap_h@
@lber_h@
+#if APR_HAS_LDAP_SSL
@ldap_ssl_h@
+#endif
+#endif
+#if APR_HAS_OPENLDAP_LDAPSDK
+@ldap_h@
+@lber_h@
+#endif
-/*
- * LDAP Compatibility
+/* LDAPv2 SDKs don't use const parameters in their prototypes.
+ * LDAPv3 SDKs do use const. When compiling with LDAPv2 SDKs, const_cast
+ * casts away the constness, but won't under LDAPv3
*/
-
#if LDAP_VERSION_MAX <= 2
-int ldap_search_ext_s(LDAP *ldap, char *base, int scope, char *filter,
- char **attrs, int attrsonly, void *servertrls, void *clientctrls,
- void *timeout, int sizelimit, LDAPMessage **res);
-void ldap_memfree(void *p);
-
-/* The const_cast is used to get around the fact that some of the LDAPv2 prototypes
- * have non-const parameters, while the same ones in LDAPv3 are const. If compiling
- * with LDAPv2, the const_cast casts away the constness, but won't under LDAPv3
- */
#define const_cast(x) ((char *)(x))
#else
#define const_cast(x) (x)
-#endif /* LDAP_VERSION_MAX */
+#endif
#include "apr_ldap_url.h"
@@ -146,5 +177,5 @@
#endif
/** @} */
-#endif /* APU_HAS_LDAP */
+#endif /* APR_HAS_LDAP */
#endif /* APU_LDAP_H */
Re: cvs commit: apr-util/include apr_ldap.hw apr_ldap.hnw apr_ldap.h.in
Posted by Joe Orton <jo...@manyfish.co.uk>.
Hi,
On Fri, Feb 14, 2003 at 04:07:20PM -0000, Brad Nicholes wrote:
> --- apr_ldap.h.in 1 Jan 2003 00:02:20 -0000 1.6
> +++ apr_ldap.h.in 14 Feb 2003 16:07:19 -0000 1.7
...
> +#define APR_HAS_NETSCAPE_LDAPSDK @apu_has_ldap_netscape@
> +#define APR_HAS_NOVELL_LDAPSDK @apu_has_ldap_novell@
> +#define APR_HAS_OPENLDAP_LDAPSDK @apu_has_ldap_openldap@
> +#define APR_HAS_MICROSOFT_LDAPSDK @apu_has_ldap_microsoft@
> +#define APR_HAS_OTHER_LDAPSDK @apu_has_ldap_other@
> +
> + /* define if LDAP SSL support is available
> + */
> +#define APR_HAS_LDAP_SSL @apu_has_ldap_ssl@
Was there an apu-conf.m4 update to go with these changes? The current
configure script doesn't seem to be defining any of these variables.
$ grep -l -r apu_has_ldap_openldap .
./include/apr_ldap.h.in
./include/apr_ldap.h
$