php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65642 sysconfdir broken in 64-bit Windows build
Submitted: 2013-09-09 15:40 UTC Modified: 2013-09-10 16:40 UTC
From: krishean+php at gmail dot com Assigned: ab (profile)
Status: Closed Package: LDAP related
PHP Version: 5.5.3 OS: Windows 7 x64
Private report: No CVE-ID: None
 [2013-09-09 15:40 UTC] krishean+php at gmail dot com
Description:
------------
When trying to bind to an ldap server over ssl, you need a file called "ldap.conf" in the directory "C:\openldap\sysconf" with a few options in it (at least on Windows, Linux is somewhere in /etc.) In the past (php 5.4 etc.) this worked wonderfully, with php checking that directory, loading the file, and connecting to the server just fine. In php 5.5.3 however, this is completely broken. I used Process Monitor to check where it was searching for ldap.conf and it seems to be searching as such: "G:\Documents\Projects\ProjectName\%SYSCONFDIR%\ldap.conf" (the ProjectName directory being where the currently executing script is located.) I checked and php 5.4.18 checks in the correct directory: "C:\openldap\sysconf\ldap.conf"

Test script:
---------------
$host = 'ldaps://server01';
$port = 636;
$rdn = 'CN=Jeff Smith,CN=users,DC=fabrikam,DC=com';
$pwd = 'password';
if(($conn = @ldap_connect($host, $port)) != FALSE){
	ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
	ldap_set_option($conn, LDAP_OPT_REFERRALS, 0);
	// bind to ldap connection
	if(($r = @ldap_bind($conn, $rdn, $pwd)) != FALSE){
		echo("Successfully connected to LDAP.\n");
	}else{
		echo("Error: Failed to bind to LDAP.\n"); // this happens
		if($conn){
			ldap_unbind($conn);
		}
		$conn = null;
	}
}else echo("Error: Failed to connect to LDAP.\n");

Expected result:
----------------
Script should bind to ldap server over ssl (ldaps://) and report success.

Actual result:
--------------
Script fails to bind to ldap server over ssl.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-10 06:31 UTC] ab@php.net
-Assigned To: +Assigned To: ab
 [2013-09-10 08:10 UTC] ab@php.net
-Status: Assigned +Status: Feedback
 [2013-09-10 08:10 UTC] ab@php.net
Please test the builds from here 
http://windows.php.net/downloads/snaps/ostc/65642/ (if possible both x64 and x86), 
they should have correct compiled in path.
 [2013-09-10 15:12 UTC] krishean+php at gmail dot com
I tested both the x86 and x64 builds of the php_ldap (threadsafe) extension and they both seem to work as intended, checking the "C:\openldap\sysconf\ldap.conf" file for configuraton parameters before successfully connecting to the ldap server over ssl.
 [2013-09-10 16:40 UTC] ab@php.net
-Status: Feedback +Status: Closed
 [2013-09-10 16:40 UTC] ab@php.net
Thanks for testing. Please use that DLLs with 5.5.3, the regular fix will come 
into the next release. In the mean time the fix can be checked in the 5.5 or 
master snapshots http://windows.php.net/downloads/snaps/php-5.5/ (check in a 
couple of days if interested).

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 21:01:29 2024 UTC