nodejs / nodejs/node

vfs: ZipProvider allows creating entries beneath non-directory parents

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

@trivikr がすでに取り組んでいます。

2026年9月5日 から。

vfs
主要言語
JavaScript
スター
122k
フォーク
37.3k
平均マージ
4日 2時間
マージ済み PR(30日)
283

説明

Version

main

Platform
macOS
Subsystem

vfs

What steps will reproduce the bug?
import { createZipArchive, ZipBuffer, ZipEntry } from 'node:zlib';
import { create, ZipProvider } from 'node:vfs';

const zipEntry = await ZipEntry.create('file.txt', Buffer.from('contents'));
const zipArchive = createZipArchive([zipEntry]);
const archive = Buffer.concat(await Array.fromAsync(zipArchive));
const fs = create(new ZipProvider(new ZipBuffer(archive)));

try {
  await fs.promises.writeFile('/file.txt/child.txt', 'hello');
  console.log('write succeeded');
} catch (error) {
  console.log(`${error.code}: ${error.message}`);
}
How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

It should fail with ENOTDIR

What do you see instead?
write succeeded

The write incorrectly succeeds even though file.txt is not a directory

Additional information

No response

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

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

はじめの一歩

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

評価

この issue はまだ評価されていません。

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

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