On Wed, 18 Sept 2024 at 12:03, Graham Leggett via dev <dev@apr.apache.org> wrote:
> On 15 Sep 2024, at 18:57, Ivan Zhakov <i...@apache.org> wrote: > > > I would be happy to enable LDAP by default, but it doesn't work right > now so I think it's better to disable it until it is fixed. I tried to fix > it, but without success. I configured GitHub Actions job with LDAP enabled: > > > https://github.com/apache/apr-util/actions/runs/10871254641/job/30164847244 > > > > Do you have any ideas how to fix it? > > Looking quickly, this symbol is in ldap//apr_ldap.c, which is missing from > the cmake build: > > Ok, I added ldap/apr_ldap.c to CMake build in r1920813. But compilation still with different error: https://github.com/apache/apr-util/actions/runs/10963954953/job/30446537433 [[[ D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(133): error C2065: 'LDAP_INSUFFICIENT_ACCESS': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(133): error C2051: case expression not constant D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(183): warning C4142: 'ldap_cleanup': benign redefinition of type C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um\winldap.h(2422): note: see declaration of 'ldap_cleanup' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(183): error C2491: 'ldap_cleanup': definition of dllimport function not allowed D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(273): error C2065: 'result': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(273): warning C4047: 'function': 'apr_ldap_err_t **' differs in levels of indirection from 'int *' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(273): warning C4024: 'apr_ldap_url_parse': different types for formal and actual parameter 4 D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(490): warning C4311: 'type cast': pointer truncation from 'void *' to 'ULONG' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(499): warning C4311: 'type cast': pointer truncation from 'void *' to 'ULONG' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1051): error C2065: 'LDAP_OPT_SUCCESS': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1090): warning C4133: 'function': incompatible types - from 'timeval *' to 'l_timeval *' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1320): error C2065: 'LDAP_SASL_QUIET': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1322): warning C4013: 'ldap_sasl_interactive_bind' undefined; assuming extern returning int D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1481): warning C4133: 'function': incompatible types - from 'timeval *' to 'PLDAP_TIMEVAL' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1619): warning C4013: 'strndup' undefined; assuming extern returning int D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1619): warning C4047: '=': 'char *' differs in levels of indirection from 'int' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1624): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1639): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1660): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1671): error C2065: 'LDAP_RES_SEARCH_REFERENCE': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1671): error C2051: case expression not constant D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1914): error C2065: 'LDAP_SASL_QUIET': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1916): error C2065: 'apr_ldap_bind_ctx_t': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1916): error C2146: syntax error: missing ';' before identifier 'payload' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1916): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1918): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1918): error C2224: left of '.ld' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1919): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1919): error C2224: left of '.interact' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1920): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1920): error C2224: left of '.ctx' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1921): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1921): error C2224: left of '.status' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1961): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1961): error C2224: left of '.status' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1963): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1963): error C2224: left of '.status' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1964): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1964): error C2224: left of '.status' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1964): warning C4033: 'apr_ldap_bind' must return a value D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1982): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1982): error C2224: left of '.status' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1984): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1984): error C2224: left of '.status' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1985): error C2065: 'payload': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1985): error C2224: left of '.status' must have struct/union type D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1985): warning C4033: 'apr_ldap_bind' must return a value D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(1990): warning C4267: '=': conversion from 'size_t' to 'ULONG', possible loss of data D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2002): warning C4090: 'function': different 'const' qualifiers D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2002): error C2065: 'LDAP_SASL_SIMPLE': undeclared identifier D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2002): warning C4047: 'function': 'const PSTR' differs in levels of indirection from 'int' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2002): warning C4024: 'ldap_sasl_bindA': different types for formal and actual parameter 3 D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2108): warning C4267: '=': conversion from 'size_t' to 'ULONG', possible loss of data D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2134): warning C4267: '=': conversion from 'size_t' to 'ULONG', possible loss of data D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2158): warning C4090: 'function': different 'const' qualifiers D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2158): warning C4090: 'function': different 'const' qualifiers D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2158): warning C4133: 'function': incompatible types - from 'berval *' to 'const PSTR' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2159): warning C4047: 'function': 'berval *' differs in levels of indirection from 'LDAPControlA **' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2159): warning C4024: 'ldap_compare_ext': different types for formal and actual parameter 5 D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2159): warning C4047: 'function': 'PLDAPControlA *' differs in levels of indirection from 'int *' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2159): warning C4024: 'ldap_compare_ext': different types for formal and actual parameter 7 D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2158): error C2198: 'ULONG ldap_compare_ext(LDAP *,const PSTR,const PSTR,const PSTR,berval *,PLDAPControlA *,PLDAPControlA *,ULONG *)': too few arguments for call D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2219): warning C4047: 'function': 'ULONG' differs in levels of indirection from 'timeval *' D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2219): warning C4024: 'ldap_search_ext': different types for formal and actual parameter 9 D:\a\apr-util\apr-util\apu\ldap\apr_ldap.c(2219): warning C4244: 'function': conversion from 'apr_ssize_t' to 'ULONG', possible loss of data ]]] Btw how did you test LDAP support on Windows? Did you use dsw files? testldap.c.obj : error LNK2019: unresolved external symbol > __imp_apr_ldap_search referenced in function test_ldap_bind_cb > > This symbol is part of the Microsoft LDAP API, is cmake binding to the > correct LDAP library on Windows? > > testldap.c.obj : error LNK2019: unresolved external symbol > __imp_ldap_unbind_s referenced in function test_legacy_ldap_connection > > > https://learn.microsoft.com/en-us/windows/win32/api/winldap/nf-winldap-ldap_bind_s > > Regards, > Graham > -- > > -- Ivan Zhakov