From:             arnout at argeweb dot nl
Operating system: freeBSD 5.4
PHP version:      5.1.2
PHP Bug Type:     CGI related
Bug description:  LDAP in nsswitch.conf causes segfault when resolving 
hostnames in PHP

Description:
------------
Any hostname resolve in PHP causes a segmentation fault.

It only happens when this file contains the ldap keyword.
When removed, everything works fine.

Everything works great when using modphp. It only happens when using the
executable.

[EMAIL PROTECTED]: / # cat /etc/nsswitch.conf
group: files ldap
group_compat: nis
hosts: files dns
networks: files
passwd: files
passwd_compat: nis
shells: files

We've seen it on two seperate systems.
It's on PHP versions 5.0.5, 5.1.1 and 5.1.2

Server #1:
openldap 2.2.30
nss_ldap 1.244
php 5.0.5
FreeBSD 5.4-RELEASE-p8

Server #2:
nss_ldap-1.239
openldap-client-2.2.27
php 5.1.2
FreeBSD 5.4-RELEASE-p8


Reproduce code:
---------------
[EMAIL PROTECTED]: / # echo "<? echo gethostbyname('php.net'); ?>" | php

[EMAIL PROTECTED]: / # echo "<? mysql_connect( 'badgerbadger', '', '' ); ?>" |
php


#!/usr/local/bin/php
<?php
// this
echo gethostbyname( 'php.net' );
// AND this too
mysql_connect( 'blahdieblah', '', '' );
// and anything that resolves.
?>


Expected result:
----------------
An IP-address and an error because the mysql host doesn't exist.

Actual result:
--------------
Segmentation fault on any line that resolves a hostname.

-- 
Edit bug report at http://bugs.php.net/?id=36206&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36206&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36206&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36206&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36206&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36206&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36206&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36206&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36206&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36206&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36206&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36206&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36206&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36206&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36206&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36206&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36206&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36206&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36206&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36206&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36206&r=mysqlcfg

Reply via email to