Skip to content

The ldap extension cannot be built on Solaris with Oracle Instant Client #15051

Description

@petk

Description

The following code:

./buildconf
./configure --with-ldap=/path/to/oracle-instantclient/instantclient_19_23/
gmake
Resulted in this output:
In file included from ./php-src/main/php.h:429,
from ./php-src/ext/ldap/ldap.c:29:
./php-src/ext/ldap/ldap_arginfo.h: In function ‘register_ldap_symbols’:
./php-src/ext/ldap/ldap_arginfo.h:773:57: error: ‘LDAP_EXOP_START_TLS’ undeclared (first use in this function)
773 | REGISTER_STRING_CONSTANT("LDAP_EXOP_START_TLS", LDAP_EXOP_START_TLS, CONST_PERSISTENT);
| ^~~~~~~~~~~~~~~~~~~
./php-src/Zend/zend_constants.h:53:108: note: in definition of macro ‘REGISTER_STRING_CONSTANT’
53 | #define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number)
| ^~~
./php-src/ext/ldap/ldap_arginfo.h:773:57: note: each undeclared identifier is reported only once for each function it appears in
773 | REGISTER_STRING_CONSTANT("LDAP_EXOP_START_TLS", LDAP_EXOP_START_TLS, CONST_PERSISTENT);
| ^~~~~~~~~~~~~~~~~~~
./php-src/Zend/zend_constants.h:53:108: note: in definition of macro ‘REGISTER_STRING_CONSTANT’
53 | #define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number)
| ^~~
./php-src/ext/ldap/ldap_arginfo.h:776:61: error: ‘LDAP_EXOP_MODIFY_PASSWD’ undeclared (first use in this function)
776 | REGISTER_STRING_CONSTANT("LDAP_EXOP_MODIFY_PASSWD", LDAP_EXOP_MODIFY_PASSWD, CONST_PERSISTENT);
| ^~~~~~~~~~~~~~~~~~~~~~~
./php-src/Zend/zend_constants.h:53:108: note: in definition of macro ‘REGISTER_STRING_CONSTANT’
53 | #define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number)
| ^~~
./php-src/ext/ldap/ldap_arginfo.h:779:55: error: ‘LDAP_EXOP_REFRESH’ undeclared (first use in this function)
779 | REGISTER_STRING_CONSTANT("LDAP_EXOP_REFRESH", LDAP_EXOP_REFRESH, CONST_PERSISTENT);
| ^~~~~~~~~~~~~~~~~
./php-src/Zend/zend_constants.h:53:108: note: in definition of macro ‘REGISTER_STRING_CONSTANT’
53 | #define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number)
| ^~~
./php-src/ext/ldap/ldap_arginfo.h:782:56: error: ‘LDAP_EXOP_WHO_AM_I’ undeclared (first use in this function)
782 | REGISTER_STRING_CONSTANT("LDAP_EXOP_WHO_AM_I", LDAP_EXOP_WHO_AM_I, CONST_PERSISTENT);
| ^~~~~~~~~~~~~~~~~~
./php-src/Zend/zend_constants.h:53:108: note: in definition of macro ‘REGISTER_STRING_CONSTANT’
53 | #define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number)
| ^~~
./php-src/ext/ldap/ldap_arginfo.h:785:52: error: ‘LDAP_EXOP_TURN’ undeclared (first use in this function); did you mean ‘LDAP_OPT_ON’?
785 | REGISTER_STRING_CONSTANT("LDAP_EXOP_TURN", LDAP_EXOP_TURN, CONST_PERSISTENT);
| ^~~~~~~~~~~~~~
./php-src/Zend/zend_constants.h:53:108: note: in definition of macro ‘REGISTER_STRING_CONSTANT’
53 | #define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name)-1, (str), (flags), module_number)
| ^~~
./php-src/ext/ldap/ldap.c: In function ‘ldap_link_free’:
./php-src/ext/ldap/ldap.c:130:9: warning: implicit declaration of function ‘ldap_destroy’; did you mean ‘mrp_destroy’? [-Wimplicit-function-declaration]
130 | ldap_destroy(ld->link);
| ^~~~~~~~~~~~
| mrp_destroy
./php-src/ext/ldap/ldap.c: In function ‘_php_ldap_control_to_array’:
./php-src/ext/ldap/ldap.c:249:37: error: ‘LDAP_CONTROL_PASSWORDPOLICYRESPONSE’ undeclared (first use in this function)
249 | if (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_PASSWORDPOLICYRESPONSE) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:251:17: error: unknown type name ‘LDAPPasswordPolicyError’
251 | LDAPPasswordPolicyError pperr;
| ^~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:254:22: warning: implicit declaration of function ‘ldap_parse_passwordpolicy_control’ [-Wimplicit-function-declaration]
254 | rc = ldap_parse_passwordpolicy_control(ld, ctrl, &expire, &grace, &pperr);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:260:39: error: ‘PP_noError’ undeclared (first use in this function)
260 | if ( pperr != PP_noError ) {
| ^~~~~~~~~~
./php-src/ext/ldap/ldap.c:267:44: error: ‘LDAP_CONTROL_PAGEDRESULTS’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_MANAGEDSAIT’?
267 | } else if (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_PAGEDRESULTS) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| LDAP_CONTROL_MANAGEDSAIT
./php-src/ext/ldap/ldap.c:274:30: warning: implicit declaration of function ‘ldap_parse_pageresponse_control’ [-Wimplicit-function-declaration]
274 | rc = ldap_parse_pageresponse_control(ld, ctrl, &lestimated, &lcookie);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:292:45: error: ‘LDAP_CONTROL_PRE_READ’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_PWDEXPIRED’?
292 | } else if ((strcmp(ctrl->ldctl_oid, LDAP_CONTROL_PRE_READ) == 0) || (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_POST_READ) == 0)) {
| ^~~~~~~~~~~~~~~~~~~~~
| LDAP_CONTROL_PWDEXPIRED
./php-src/ext/ldap/ldap.c:292:102: error: ‘LDAP_CONTROL_POST_READ’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_NOT_FOUND’?
292 | } else if ((strcmp(ctrl->ldctl_oid, LDAP_CONTROL_PRE_READ) == 0) || (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_POST_READ) == 0)) {
| ^~~~~~~~~~~~~~~~~~~~~~
| LDAP_CONTROL_NOT_FOUND
./php-src/ext/ldap/ldap.c:309:33: error: unknown type name ‘BerVarray’
309 | BerVarray vals = NULL;
| ^~~~~~~~~
./php-src/ext/ldap/ldap.c:309:50: warning: initialization of ‘int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
309 | BerVarray vals = NULL;
| ^~~~
./php-src/ext/ldap/ldap.c:312:88: warning: comparison between pointer and integer
312 | if (ber_scanf(ber, "[W]", &vals) == LBER_ERROR || vals == NULL)
| ^~
./php-src/ext/ldap/ldap.c:318:49: error: subscripted value is neither array nor pointer nor vector
318 | for (i = 0; vals[i].bv_val != NULL; i++) {
| ^
./php-src/ext/ldap/ldap.c:319:74: error: subscripted value is neither array nor pointer nor vector
319 | add_next_index_stringl(&tmp, vals[i].bv_val, vals[i].bv_len);
| ^
./php-src/ext/ldap/ldap.c:319:90: error: subscripted value is neither array nor pointer nor vector
319 | add_next_index_stringl(&tmp, vals[i].bv_val, vals[i].bv_len);
| ^
./php-src/ext/ldap/ldap.c:323:33: warning: implicit declaration of function ‘ber_bvarray_free’ [-Wimplicit-function-declaration]
323 | ber_bvarray_free(vals);
| ^~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:331:44: error: ‘LDAP_CONTROL_SORTRESPONSE’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_NOT_FOUND’?
331 | } else if (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_SORTRESPONSE) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| LDAP_CONTROL_NOT_FOUND
./php-src/ext/ldap/ldap.c:337:30: warning: implicit declaration of function ‘ldap_parse_sortresponse_control’ [-Wimplicit-function-declaration]
337 | rc = ldap_parse_sortresponse_control(ld, ctrl, &errcode, &attribute);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:352:44: error: ‘LDAP_CONTROL_VLVRESPONSE’ undeclared (first use in this function)
352 | } else if (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_VLVRESPONSE) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:358:30: warning: implicit declaration of function ‘ldap_parse_vlvresponse_control’ [-Wimplicit-function-declaration]
358 | rc = ldap_parse_vlvresponse_control(ld, ctrl, &target, &count, &context, &errcode);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:371:25: warning: implicit declaration of function ‘ber_bvfree’; did you mean ‘ber_free’? [-Wimplicit-function-declaration]
371 | ber_bvfree(context);
| ^~~~~~~~~~
| ber_free
./php-src/ext/ldap/ldap.c: In function ‘_php_ldap_control_from_array’:
./php-src/ext/ldap/ldap.c:390:9: error: unknown type name ‘LDAPSortKey’
390 | LDAPSortKey** sort_keys = NULL;
| ^~~~~~~~~~~
./php-src/ext/ldap/ldap.c:423:58: error: ‘LDAP_CONTROL_PAGEDRESULTS’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_MANAGEDSAIT’?
423 | } else if (strcmp(ZSTR_VAL(control_oid), LDAP_CONTROL_PAGEDRESULTS) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| LDAP_CONTROL_MANAGEDSAIT
./php-src/ext/ldap/ldap.c:441:30: warning: implicit declaration of function ‘ldap_create_page_control_value’ [-Wimplicit-function-declaration]
441 | rc = ldap_create_page_control_value(ld, pagesize, &cookie, &control_value);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:445:58: error: ‘LDAP_CONTROL_ASSERT’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_MANAGEDSAIT’?
445 | } else if (strcmp(ZSTR_VAL(control_oid), LDAP_CONTROL_ASSERT) == 0) {
| ^~~~~~~~~~~~~~~~~~~
| LDAP_CONTROL_MANAGEDSAIT
./php-src/ext/ldap/ldap.c:460:53: error: ‘LDAP_OPT_RESULT_CODE’ undeclared (first use in this function); did you mean ‘LDAP_OPT_RESTART’?
460 | ldap_set_option(ld, LDAP_OPT_RESULT_CODE, &success);
| ^~~~~~~~~~~~~~~~~~~~
| LDAP_OPT_RESTART
./php-src/ext/ldap/ldap.c:463:38: warning: implicit declaration of function ‘ldap_create_assertion_control_value’ [-Wimplicit-function-declaration]
463 | rc = ldap_create_assertion_control_value(ld, ZSTR_VAL(assert), &control_value);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:469:58: error: ‘LDAP_CONTROL_VALUESRETURNFILTER’ undeclared (first use in this function)
469 | } else if (strcmp(ZSTR_VAL(control_oid), LDAP_CONTROL_VALUESRETURNFILTER) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:475:39: warning: implicit declaration of function ‘ber_alloc_t’ [-Wimplicit-function-declaration]
475 | ber = ber_alloc_t(LBER_USE_DER);
| ^~~~~~~~~~~
./php-src/ext/ldap/ldap.c:475:37: warning: assignment to ‘BerElement *’ {aka ‘struct berelement *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
475 | ber = ber_alloc_t(LBER_USE_DER);
| ^
./php-src/ext/ldap/ldap.c:485:45: warning: implicit declaration of function ‘ldap_put_vrFilter’ [-Wimplicit-function-declaration]
485 | if (ldap_put_vrFilter(ber, ZSTR_VAL(tmpstring)) == -1) {
| ^~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:488:52: warning: implicit declaration of function ‘ber_flatten2’ [-Wimplicit-function-declaration]
488 | } else if (ber_flatten2(ber, &control_value, control_value_alloc) == -1) {
| ^~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:493:59: error: ‘LDAP_CONTROL_PRE_READ’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_PWDEXPIRED’?
493 | } else if ((strcmp(ZSTR_VAL(control_oid), LDAP_CONTROL_PRE_READ) == 0) || (strcmp(ZSTR_VAL(control_oid), LDAP_CONTROL_POST_READ) == 0)) {
| ^~~~~~~~~~~~~~~~~~~~~
| LDAP_CONTROL_PWDEXPIRED
./php-src/ext/ldap/ldap.c:493:122: error: ‘LDAP_CONTROL_POST_READ’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_NOT_FOUND’?
493 | } else if ((strcmp(ZSTR_VAL(control_oid), LDAP_CONTROL_PRE_READ) == 0) || (strcmp(ZSTR_VAL(control_oid), LDAP_CONTROL_POST_READ) == 0)) {
| ^~~~~~~~~~~~~~~~~~~~~~
| LDAP_CONTROL_NOT_FOUND
./php-src/ext/ldap/ldap.c:499:37: warning: assignment to ‘BerElement *’ {aka ‘struct berelement *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
499 | ber = ber_alloc_t(LBER_USE_DER);
| ^
./php-src/ext/ldap/ldap.c:530:41: warning: implicit declaration of function ‘ber_init2’; did you mean ‘ber_init’? [-Wimplicit-function-declaration]
530 | ber_init2( ber, NULL, LBER_USE_DER );
| ^~~~~~~~~
| ber_init
./php-src/ext/ldap/ldap.c:532:45: warning: implicit declaration of function ‘ber_printf’; did you mean ‘php_printf’? [-Wimplicit-function-declaration]
532 | if (ber_printf(ber, "{v}", ldap_attrs) == -1) {
| ^~~~~~~~~~
| php_printf
./php-src/ext/ldap/ldap.c:545:58: error: ‘LDAP_CONTROL_SORTREQUEST’ undeclared (first use in this function); did you mean ‘LDAP_CONTROL_NOT_FOUND’?
545 | } else if (strcmp(ZSTR_VAL(control_oid), LDAP_CONTROL_SORTREQUEST) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
| LDAP_CONTROL_NOT_FOUND
In file included from ./php-src/Zend/zend.h:30,
from ./php-src/main/php.h:31,
from ./php-src/ext/ldap/ldap.c:29:
./php-src/ext/ldap/ldap.c:550:71: error: ‘LDAPSortKey’ undeclared (first use in this function)
550 | sort_keys = safe_emalloc((num_keys+1), sizeof(LDAPSortKey*), 0);
| ^~~~~~~~~~~
./php-src/Zend/zend_alloc.h:154:73: note: in definition of macro ‘safe_emalloc’
154 | #define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
| ^~~~
./php-src/ext/ldap/ldap.c:550:83: error: expected expression before ‘)’ token
550 | sort_keys = safe_emalloc((num_keys+1), sizeof(LDAPSortKey*), 0);
| ^
./php-src/Zend/zend_alloc.h:154:73: note: in definition of macro ‘safe_emalloc’
154 | #define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
| ^~~~
./php-src/ext/ldap/ldap.c:574:45: error: request for member ‘attributeType’ in something not a structure or union
574 | sort_keys[i]->attributeType = ZSTR_VAL(tmpstrings1[num_tmpstrings1]);
| ^~
./php-src/ext/ldap/ldap.c:583:53: error: request for member ‘orderingRule’ in something not a structure or union
583 | sort_keys[i]->orderingRule = ZSTR_VAL(tmpstrings2[num_tmpstrings2]);
| ^~
./php-src/ext/ldap/ldap.c:586:53: error: request for member ‘orderingRule’ in something not a structure or union
586 | sort_keys[i]->orderingRule = NULL;
| ^~
./php-src/ext/ldap/ldap.c:590:53: error: request for member ‘reverseOrder’ in something not a structure or union
590 | sort_keys[i]->reverseOrder = zend_is_true(tmp);
| ^~
./php-src/ext/ldap/ldap.c:592:53: error: request for member ‘reverseOrder’ in something not a structure or union
592 | sort_keys[i]->reverseOrder = 0;
| ^~
./php-src/ext/ldap/ldap.c:598:30: warning: implicit declaration of function ‘ldap_create_sort_control_value’ [-Wimplicit-function-declaration]
598 | rc = ldap_create_sort_control_value(ld, sort_keys, &control_value);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:602:58: error: ‘LDAP_CONTROL_VLVREQUEST’ undeclared (first use in this function)
602 | } else if (strcmp(ZSTR_VAL(control_oid), LDAP_CONTROL_VLVREQUEST) == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:604:25: error: unknown type name ‘LDAPVLVInfo’; did you mean ‘LDAPFiltInfo’?
604 | LDAPVLVInfo vlvInfo;
| ^~~~~~~~~~~
| LDAPFiltInfo
./php-src/ext/ldap/ldap.c:609:40: error: request for member ‘ldvlv_before_count’ in something not a structure or union
609 | vlvInfo.ldvlv_before_count = zval_get_long(tmp);
| ^
./php-src/ext/ldap/ldap.c:617:40: error: request for member ‘ldvlv_after_count’ in something not a structure or union
617 | vlvInfo.ldvlv_after_count = zval_get_long(tmp);
| ^
./php-src/ext/ldap/ldap.c:632:40: error: request for member ‘ldvlv_attrvalue’ in something not a structure or union
632 | vlvInfo.ldvlv_attrvalue = &attrValue;
| ^
./php-src/ext/ldap/ldap.c:634:40: error: request for member ‘ldvlv_attrvalue’ in something not a structure or union
634 | vlvInfo.ldvlv_attrvalue = NULL;
| ^
./php-src/ext/ldap/ldap.c:635:40: error: request for member ‘ldvlv_offset’ in something not a structure or union
635 | vlvInfo.ldvlv_offset = zval_get_long(tmp);
| ^
./php-src/ext/ldap/ldap.c:638:48: error: request for member ‘ldvlv_count’ in something not a structure or union
638 | vlvInfo.ldvlv_count = zval_get_long(tmp);
| ^
./php-src/ext/ldap/ldap.c:658:40: error: request for member ‘ldvlv_context’ in something not a structure or union
658 | vlvInfo.ldvlv_context = &context;
| ^
./php-src/ext/ldap/ldap.c:660:40: error: request for member ‘ldvlv_context’ in something not a structure or union
660 | vlvInfo.ldvlv_context = NULL;
| ^
./php-src/ext/ldap/ldap.c:665:30: warning: implicit declaration of function ‘ldap_create_vlv_control_value’ [-Wimplicit-function-declaration]
665 | rc = ldap_create_vlv_control_value(ld, &vlvInfo, &control_value);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./php-src/ext/ldap/ldap.c:676:22: warning: implicit declaration of function ‘ldap_control_create’; did you mean ‘ldap_control_free’? [-Wimplicit-function-declaration]
676 | rc = ldap_control_create(ZSTR_VAL(control_oid), control_iscritical, &control_value, 1, ctrl);
| ^~~~~~~~~~~~~~~~~~~
| ldap_control_free
./php-src/ext/ldap/ldap.c:699:17: warning: implicit declaration of function ‘ber_memfree’; did you mean ‘ber_free’? [-Wimplicit-function-declaration]
699 | ber_memfree(control_value.bv_val);
| ^~~~~~~~~~~
| ber_free
./php-src/ext/ldap/ldap.c:708:31: error: ‘sortp’ undeclared (first use in this function)
708 | LDAPSortKey** sortp = sort_keys;
| ^~~~~
gmake: *** [Makefile:1533: ext/ldap/ldap.lo] Error 1
gmake: *** Waiting for unfinished jobs....

But I expected this output instead:

# Successful build

When using OpenLDAP, build works. Issue is that Oracle's LDAP implementation lacks several features added to ext/ldap with only OpenLDAP in mind. As far as I see this hasn't been reported by anyone yet, so I would simply suggest to remove the Oracle's LDAP adjustments in the build system so the OpenLDAP is used there only (./configure --with-ldap).

EDIT: This has been also reported at https://bugs.php.net/80926

  • Oracle Instant Client 19.23

PHP Version

PHP 8.2+

Operating System

Oracle Solaris 11.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions