File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,14 @@ LDAPinit_constants(PyObject *m)
231
231
if (PyModule_AddIntConstant (m , "LIBLDAP_R" , thread_safe ) != 0 )
232
232
return -1 ;
233
233
234
+ if (ldap_get_option (NULL , LDAP_OPT_API_INFO , & ldap_version_info ) != LDAP_SUCCESS ) {
235
+ PyErr_SetString (PyExc_ImportError , "unrecognised libldap version" );
236
+ return -1 ;
237
+ }
238
+ if (PyModule_AddIntConstant (m , "_VENDOR_VERSION_RUNTIME" ,
239
+ ldap_version_info .ldapai_vendor_version ) != 0 )
240
+ return -1 ;
241
+
234
242
/* Generated constants -- see Lib/ldap/constants.py */
235
243
236
244
#define add_err (n ) do { \
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ extern PyObject *LDAPerror(LDAP *);
13
13
extern PyObject * LDAPraise_for_message (LDAP * , LDAPMessage * m );
14
14
PyObject * LDAPerr (int errnum );
15
15
16
+ extern LDAPAPIInfo ldap_version_info ;
17
+
16
18
#ifndef LDAP_CONTROL_PAGE_OID
17
19
#define LDAP_CONTROL_PAGE_OID "1.2.840.113556.1.4.319"
18
20
#endif /* !LDAP_CONTROL_PAGE_OID */
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ PyMODINIT_FUNC init_ldap(void);
16
16
#define _STR (x ) #x
17
17
#define STR (x ) _STR(x)
18
18
19
+ LDAPAPIInfo ldap_version_info = {
20
+ .ldapai_info_version = LDAP_API_INFO_VERSION ,
21
+ };
22
+
19
23
static char version_str [] = STR (LDAPMODULE_VERSION );
20
24
static char author_str [] = STR (LDAPMODULE_AUTHOR );
21
25
static char license_str [] = STR (LDAPMODULE_LICENSE );
You can’t perform that action at this time.
0 commit comments