diff --git a/Modules/LDAPObject.h b/Modules/LDAPObject.h index a456bce0..1b6066db 100644 --- a/Modules/LDAPObject.h +++ b/Modules/LDAPObject.h @@ -5,12 +5,6 @@ #include "common.h" -#include "lber.h" -#include "ldap.h" -#if LDAP_API_VERSION < 2040 -#error Current python-ldap requires OpenLDAP 2.4.x -#endif - #if PYTHON_API_VERSION < 1007 typedef PyObject *_threadstate; #else diff --git a/Modules/berval.h b/Modules/berval.h index 2aa9c977..9c427240 100644 --- a/Modules/berval.h +++ b/Modules/berval.h @@ -4,7 +4,6 @@ #define __h_berval #include "common.h" -#include "lber.h" PyObject *LDAPberval_to_object(const struct berval *bv); PyObject *LDAPberval_to_unicode_object(const struct berval *bv); diff --git a/Modules/common.h b/Modules/common.h index affa5f93..1ce2eb83 100644 --- a/Modules/common.h +++ b/Modules/common.h @@ -12,6 +12,30 @@ #include "config.h" #endif +#include +#include +#include + +#if LDAP_API_VERSION < 2040 +#error Current python-ldap requires OpenLDAP 2.4.x +#endif + +#if LDAP_VENDOR_VERSION >= 20448 + /* openldap.h with ldap_init_fd() was introduced in 2.4.48 + * see https://bugs.openldap.org/show_bug.cgi?id=8671 + */ +#include +#else + /* ldap_init_fd() has been around for a very long time + * SSSD has been defining the function for a while, so it's probably OK. + */ +#define LDAP_PROTO_TCP 1 +#define LDAP_PROTO_UDP 2 +#define LDAP_PROTO_IPC 3 +extern int ldap_init_fd(ber_socket_t fd, int proto, LDAP_CONST char *url, + LDAP **ldp); +#endif + #if defined(MS_WINDOWS) #include #else /* unix */ diff --git a/Modules/constants.c b/Modules/constants.c index 88658c55..8b902e02 100644 --- a/Modules/constants.c +++ b/Modules/constants.c @@ -4,8 +4,6 @@ #include "common.h" #include "constants.h" #include "ldapcontrol.h" -#include "lber.h" -#include "ldap.h" /* the base exception class */ diff --git a/Modules/constants.h b/Modules/constants.h index b8150949..7b9ce53e 100644 --- a/Modules/constants.h +++ b/Modules/constants.h @@ -4,8 +4,6 @@ #define __h_constants_ #include "common.h" -#include "lber.h" -#include "ldap.h" extern int LDAPinit_constants(PyObject *m); extern PyObject *LDAPconstant(int); diff --git a/Modules/functions.c b/Modules/functions.c index 9e0312db..ce4a924a 100644 --- a/Modules/functions.c +++ b/Modules/functions.c @@ -30,22 +30,7 @@ l_ldap_initialize(PyObject *unused, PyObject *args) return (PyObject *)newLDAPObject(ld); } -#ifdef HAVE_LDAP_INIT_FD - -/* initialize_fd(fileno, url) - * - * ldap_init_fd() is not a private API but it's not in a public header either - * SSSD has been using the function for a while, so it's probably OK. - */ - -#ifndef LDAP_PROTO_TCP -#define LDAP_PROTO_TCP 1 -#define LDAP_PROTO_UDP 2 -#define LDAP_PROTO_IPC 3 -#endif - -extern int - ldap_init_fd(ber_socket_t fd, int proto, LDAP_CONST char *url, LDAP **ldp); +/* initialize_fd(fileno, url) */ static PyObject * l_ldap_initialize_fd(PyObject *unused, PyObject *args) @@ -97,7 +82,6 @@ l_ldap_initialize_fd(PyObject *unused, PyObject *args) return (PyObject *)newLDAPObject(ld); } -#endif /* HAVE_LDAP_INIT_FD */ /* ldap_str2dn */ @@ -206,9 +190,7 @@ l_ldap_get_option(PyObject *self, PyObject *args) static PyMethodDef methods[] = { {"initialize", (PyCFunction)l_ldap_initialize, METH_VARARGS}, -#ifdef HAVE_LDAP_INIT_FD {"initialize_fd", (PyCFunction)l_ldap_initialize_fd, METH_VARARGS}, -#endif {"str2dn", (PyCFunction)l_ldap_str2dn, METH_VARARGS}, {"set_option", (PyCFunction)l_ldap_set_option, METH_VARARGS}, {"get_option", (PyCFunction)l_ldap_get_option, METH_VARARGS}, diff --git a/Modules/ldapcontrol.c b/Modules/ldapcontrol.c index 5e2d2ff8..e287e9a3 100644 --- a/Modules/ldapcontrol.c +++ b/Modules/ldapcontrol.c @@ -6,8 +6,6 @@ #include "berval.h" #include "constants.h" -#include "lber.h" - /* Prints to stdout the contents of an array of LDAPControl objects */ /* XXX: This is a debugging tool, and the printf generates some warnings diff --git a/Modules/ldapcontrol.h b/Modules/ldapcontrol.h index de694c07..74cae423 100644 --- a/Modules/ldapcontrol.h +++ b/Modules/ldapcontrol.h @@ -4,7 +4,6 @@ #define __h_ldapcontrol #include "common.h" -#include "ldap.h" void LDAPinit_control(PyObject *d); void LDAPControl_List_DEL(LDAPControl **); diff --git a/Modules/message.h b/Modules/message.h index 2978ea56..ed73f32c 100644 --- a/Modules/message.h +++ b/Modules/message.h @@ -4,8 +4,6 @@ #define __h_message #include "common.h" -#include "lber.h" -#include "ldap.h" extern PyObject *LDAPmessage_to_python(LDAP *ld, LDAPMessage *m, int add_ctrls, int add_intermediates); diff --git a/setup.py b/setup.py index 4559d840..69747853 100644 --- a/setup.py +++ b/setup.py @@ -145,7 +145,6 @@ class OpenLDAP2: ('LDAPMODULE_VERSION', pkginfo.__version__), ('LDAPMODULE_AUTHOR', pkginfo.__author__), ('LDAPMODULE_LICENSE', pkginfo.__license__), - ('HAVE_LDAP_INIT_FD', None), ] ), ], pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy