プロジェクト

全般

プロフィール

Backport(バックポート) #1999

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

関係しているリビジョン

リビジョン c85906b5 (差分)
Kousuke Ebihara約13年前に追加

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

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

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

This reverts commit c85906b57b7dbf201074a2959770360d9969df68 from stable branch.

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

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

履歴

#1 Kousuke Ebihara約13年前に更新

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

http://redmine.openpne.jp/issues/1908#note-4 に記載のとおり、 3.0 では必要最低限度の修正のみを抜き出したパッチを適用することで対応をおこないます。

#2 Kousuke Ebihara約13年前に更新

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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