php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49808 ldap configure issue
Submitted: 2009-10-08 07:56 UTC Modified: 2009-10-09 02:38 UTC
From: sriram dot natarajan at gmail dot com Assigned: srinatar (profile)
Status: Not a bug Package: LDAP related
PHP Version: 5.3SVN-2009-10-08 (snap) OS: unix
Private report: No CVE-ID: None
 [2009-10-08 07:56 UTC] sriram dot natarajan at gmail dot com
Description:
------------
php ldap extension's config.m4 when enabled with ldap extension checks to see if certain ldap functions are to be enabled. currently, these ldap functions are checked to be available on the system rather than with the ldap library that the customer is trying to compile with

for example, if i try to php with openldap on solaris or aix, current ldap's config.m4 extension uses AC_CHECK_FUNCS to determine if these functions are available on the system . this is ok, if ldap library is available on the system (like is the case with linux)

better solution would be to check if these functions are avaialable with the ldap library provided at this option : --with-ldap=<directory>


Reproduce code:
---------------
compiling with --with-ldap=<path-to-openldap> on aix or solaris machine causes these ldap functions to be not available even though opendlap library has them

Expected result:
----------------
ldap_parse_result, ldap_start_tls_s functions should be available on any unix systems if compiled against openldap library

Actual result:
--------------
all ldap functions are avaialable if linked against openldap

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-08 07:58 UTC] srinatar@php.net
here is a patch that addresses this issue
[sn123202@mbelshe]'php-5.2.11'>diff -u ext/ldap/config.m4.ORIG ext/ldap/config.m4
--- ext/ldap/config.m4.ORIG     Wed Oct  7 23:58:39 2009
+++ ext/ldap/config.m4  Thu Oct  8 00:37:21 2009
@@ -181,7 +181,10 @@
 
   dnl Solaris 2.8 claims to be 2004 API, but doesn't have
   dnl ldap_parse_reference() nor ldap_start_tls_s()
-  AC_CHECK_FUNCS([ldap_parse_result ldap_parse_reference ldap_start_tls_s])
+  dnl Verify whether the LDAP_DIR includes these ldap functions.
+  AC_CHECK_LIB([ldap_parse_result], [ldap], [HAVE_LDAP_PARSE_RESULT])
+  AC_CHECK_LIB([ldap_parse_reference], [ldap], [HAVE_LDAP_PARSE_REFERENCE])
+  AC_CHECK_LIB([ldap_start_tls_s], [ldap], [HAVE_LDAP_START_TLS_S])
   
   dnl
   dnl SASL check

if no one has objections to this suggested patch, i can commit it
 [2009-10-08 10:09 UTC] jani@php.net
I have objection because that patch won't work. And it's exactly same thing as what is already done in ext/ldap/config.m4.

What was the configure line you used? Are you using proper autoconf version (only supported and working one is 2.13!)
 [2009-10-09 02:38 UTC] srinatar@php.net
Jani
 you are right. using autoconf 2.13 made this problem go away. i should haved listened to the warning when i ran buildconf.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 23:01:30 2024 UTC