プロジェクト

全般

プロフィール

Backport(バックポート) #1996

Installing some plugins were failed with PHP 5.3.4+ (PHP 5.3.4 以上でプラグインの展開に失敗することがある)

Kousuke Ebiharaほぼ13年前に追加. ほぼ13年前に更新.

ステータス:
Fixed(完了)
優先度:
Normal(通常)
担当者:
対象バージョン:
開始日:
2011-02-07
期日:
進捗率:

100%


説明

Overview (現象)

Executing opPlugin:install was failed with the following error.

opPlugin:install の実行が以下のエラーによって失敗することがある。

Installation of "opAuthMobileUIDPlugin" plugin failed: unable to unpack /path/to/OpenPNE3/cache/.pear/opAuthMobileUIDPlugin-1.0.0.tgz

Causes (原因)

Executing opPlugin:install was failed on extracting a long-named file in plugin package.

Tar can't put >= 100 bytes filename in a header (this limitation comes from the specification). So some derived tar specs are able to do it for using special ways.

Archive_Tar follows GNU tar specification. This specification allows to store filename in fixed length content part. Content of that part must be 512 bytes, so archivers cover the deficits by using NULL.

Archive_Tar 1.3.2, which is used by OpenPNE 3, doesn't consider NULL after the long filename. It try to open file handler for writing filename with NULL by using fopen(). On PHP 5.3.3 and before, fopen() recognizes that end of the filename is first NULL, as a result, that file was written correctly. However on PHP 5.3.4 and after, failed to open that file and failed to extract that file because that version of PHP has the following changes for preventing NULL-byte attack.

http://svn.php.net/viewvc?view=revision&revision=305507

プラグインパッケージ内の長い名前を持ったファイルを展開する場面で opPlugin:install の実行が失敗する。

tar は仕様上の制限によりヘッダに 100 バイト以上のファイル名を格納することができない。そのため、派生した tar の仕様では特別な方法によりそれを可能にしているものがある。

Archive_Tar は GNU tar の仕様に従っている。この仕様は固定長のコンテンツ部にファイル名を格納することを可能にしているものである。このパートの内容は 512 バイトでなければならないため、アーカイバは NULL を用いることで不足を埋めている。

OpenPNE 3 で用いている Archive_Tar 1.3.2 は後続の NULL を考慮しておらず、 fopen() で NULL バイト付きファイル名の書き込み用にファイルハンドラをオープンしようとする。 PHP 5.3.3 以前では最初の NULL がファイル名の終端としてみなされ、結果的には Archive_Tar の想定通りにファイルが書き込まれる。ところが、 PHP 5.3.4 からは NULL byte attack の対策として以下の変更がおこなわれているため、ファイルのオープンがおこなえず、そのファイルの抽出に失敗してしまう。

http://svn.php.net/viewvc?view=revision&revision=305507

Way to fix (修正内容)

関連情報


関連するチケット

関連している OpenPNE 3 - Bug(バグ) #1908: Installing some plugins were failed with PHP 5.3.4+ (PHP 5.3.4 以上でプラグインの展開に失敗することがある) Fixed(完了) 2011-02-07

関係しているリビジョン

リビジョン 6871ea63 (差分)
Kousuke Ebiharaほぼ13年前に追加

updated PEAR::Archive_Tar to 1.3.7 for avoiding error on extracting long-named file with PHP 5.3.4+ (fixes #1996, BP from #1908)

リビジョン ebe95299 (差分)
Kousuke Ebiharaほぼ13年前に追加

updated PEAR::Archive_Tar to 1.3.7 for avoiding error on extracting long-named file with PHP 5.3.4+ (fixes #1996, BP from #1908)

リビジョン de9ca60a (差分)
Kousuke Ebiharaほぼ13年前に追加

Revert "updated PEAR::Archive_Tar to 1.3.7 for avoiding error on extracting long-named file with PHP 5.3.4+ (fixes #1996, BP from #1908)"

This reverts commit 6871ea63242f9b7296c469c9772e61cb74e73330 from stable branch

履歴

#1 Kousuke Ebiharaほぼ13年前に更新

  • ステータスNew(新規) から Accepted(着手) に変更
  • 担当者Kousuke Ebihara にセット

http://redmine.openpne.jp/issues/1908#note-4 に記載のとおり、 3.6 では Archive_Tar のバージョンアップによる対応をおこないます。

#2 Kousuke Ebiharaほぼ13年前に更新

  • ステータスAccepted(着手) から Pending Review(レビュー待ち) に変更
  • 進捗率0 から 50 に変更

更新履歴 6871ea63242f9b7296c469c9772e61cb74e73330 で適用されました。

#3 Kousuke Ebiharaほぼ13年前に更新

  • 題名プラグインのtgzファイル名に不要なスペースがつくことがある から Installing some plugins were failed with PHP 5.3.4+ (PHP 5.3.4 以上でプラグインの展開に失敗することがある) に変更

#4 Kousuke Ebiharaほぼ13年前に更新

更新履歴 de9ca60a86c78caab8ca5f0eba80b1cf7bf34122 で適用されました。

#5 Kousuke Ebiharaほぼ13年前に更新

更新履歴 ebe9529964232208b08ab9cb3d12ce06d63c1f64 で適用されました。

#6 Kousuke Ebiharaほぼ13年前に更新

緊急リリース後のマージ作業の関係で、 stable ブランチから変更を一時的に取り除きました。 ebe9529964232208b08ab9cb3d12ce06d63c1f64 のコミットがリリースブランチへの変更となります。

#7 Rimpei Ogawaほぼ13年前に更新

  • ステータスPending Review(レビュー待ち) から Pending Testing(テスト待ち) に変更
  • 進捗率50 から 70 に変更

3.6beta9 ブランチの変更および、stable-3.6.x ブランチの変更取り消し確認OKです。

#8 Mutsumi Imamuraほぼ13年前に更新

  • ステータスPending Testing(テスト待ち) から Fixed(完了) に変更
  • 進捗率70 から 100 に変更

http://redmine.openpne.jp/issues/1908#note-8 のコメントの通りテスト完了しています。

他の形式にエクスポート: Atom PDF