ID:               21167
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Feedback
+Status:           Closed
 Bug Type:         Reproducible crash
 Operating System: Linux Redhat 8.0
 PHP Version:      4.2.2
 New Comment:

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

The 4.3.0 release will soon be released as 'stable', the RC4 is
probably 99.5% of what the 4.3.0 final will be. If using 4.3.0 solves
the bug, that is the release you should probably use. 


Previous Comments:
------------------------------------------------------------------------

[2002-12-23 12:25:47] [EMAIL PROTECTED]

It works with php4-200212231630.

Does anybody know if this is patched on a production release?

------------------------------------------------------------------------

[2002-12-23 12:07:27] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip



------------------------------------------------------------------------

[2002-12-23 12:06:48] [EMAIL PROTECTED]

The following code will segfault with php-4.2.2 on RH-8.0
It queries a Microsoft Active Directory via LDAPv3.
It is suposed to create a session if a given user exists in the
directory, belongs to a given group and can bind to the directory with
the given password.

$ds=ldap_connect($LDAP_SERVER);
if($ds){

        ldap_bind($ds, $QUERYUSER_DN, $QUERYUSER_PASS);
        $err=ldap_errno($ds);
        if($err==0){
                $sr=ldap_search($ds, $BASE_DN, "samaccountname=rsaura",
array ("distinguishedName"), 0, 10000, 30, LDAP_DEREF_NEVER);
                $entry = ldap_first_entry($ds, $sr);
                if($entry == FALSE){
                        exit;
                }
                $attrs = ldap_get_attributes($ds, $entry);
                $dn = $attrs["distinguishedName"][0];

                $test=0;
                $sr = ldap_search($ds, $BASE_DN, $GROUP_MEMBERSHIP,
array ("member"), 0, 10000, 30, LDAP_DEREF_NEVER);
                $entry = ldap_first_entry($ds, $sr);
                $attrs = ldap_get_attributes($ds, $entry);
                foreach ($attrs["member"] as $user){
                        if($user==$dn){
                                $test=1;
                                break;
                        }
                }
                if($test==0){
                        exit;
                }
                ldap_close($ds); <---segfaults here!
        } else {
                exit;
        }
} else {
        exit;
}

$ds=ldap_connect($LDAP_SERVER);

if($ds){
        ldap_bind($ds, $dn, $password);
        $err=ldap_errno($ds);
        if($err==0){
                $loginok=1;
        } else {
                exit;   
        }
        ldap_close($ds);
} else {
        exit;
}

if($loginok == 1){
        session_start();
        session_register("loginok");
}

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21167&edit=1

Reply via email to