Closing PDO descriptors for child processes
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
Description
At least on Unix systems, whenever PHP creates a child process, whether through conventional means like shell_exec(), passthru(), or proc_open(), or through stuff like pcntl_fork(), the child process inherits all of the open file descriptors, including any open authenticated PDO database connections.
This is generally not desirable. Even in contexts where it's not a security concern, two processes should not share one connection to a database because the first one to use it will mess it up for the other one.
In other languages, this is avoided by calling something like:
fcntl( fd, F_SETFD, F_CLOEXEC );
on the database's file handle. But PHP doesn't provide this functionality (that I'm aware of) without exotic extensions and even if it did, there's no way (that I'm aware of) to get at the system file descriptor corresponding to a PDO connection.
Would it be possible/reasonable to add something to PDO::setAttribute() that would, when invoked, set that flag on the underlying descriptor where it is applicable?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
PDO::setAttribute() と、issue で挙げられている Unix プロセスパスである shell_exec()、passthru()、proc_open()、pcntl_fork() から始めます。PDO 接続がどのようにディスクリプタを公開または継承するかを確認し、要求された動作に対するカバレッジを定義します。対応する設定によって、該当する場合に継承が防止されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- backend, databases
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100