vfs: ZipProvider allows creating entries beneath non-directory parents

Đang mở
#65,828 0 bình luận 1 reaction 1 người được giao Xem trên GitHub

@trivikr đang làm issue này rồi.

Từ ngày 5/9/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

vfs
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

Ngôn ngữ chính
JavaScript
Star
122k
Fork
37.4k
Merge trung bình
4 ngày 3 giờ
Pull request đã merge (30 ngày)
273

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nodejs/node

Tất cả issue của nodejs/node

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.