php / php/php-src

ldap_search not working with base=NULL after php7.1

オープン
#7,998 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Bug Extension: ldap Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.1k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

Description

The following code:

<?php
$ds = ldap_connect(); // <-- URI from /etc/openldap/ldap.conf
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);

$sr = ldap_search($ds, NULL, "(uid=dab)", array("dn"));  // <-- BASE from /etc/openldap/ldap.conf
$entry = ldap_first_entry($ds, $sr);
var_dump($entry);

Resulted in this output:

Warning: ldap_search(): Search: No such object in test.php on line 5

But I expected this output instead:

resource(6) of type (ldap result entry)

/etc/openldap/ldap.conf:
BASE c=ru
URI ldap://localhost

slapd.log:
version <=php7.1
slapd[14091]: conn=4230904 op=0 SRCH base="c=ru" scope=2 deref=0 filter="(uid=dab)"
version >php7.1
slapd[14091]: conn=4230791 op=0 SRCH base="" scope=2 deref=0 filter="(uid=dab)"

related bug&commit:
https://bugs.php.net/bug.php?id=77958
https://github.com/php/php-src/commit/5d2fe48785b6d24102ff53e78631cba7f2aefbef

PHP Version

PHP 8.0.12

Operating System

gentoo

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ldap_search のエントリポイントから開始し、再現手順で示されている動作を、リンク先のバグおよびコミット 5d2fe48785b6d24102ff53e78631cba7f2aefbef と比較します。提供されている PHP スクリプトを指定された LDAP 設定に対して実行し、slapd.log を確認します。NULL の base が設定済みの BASE を使用し、検索で期待されるエントリが返されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
backend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。