nodejs / nodejs/node

vfs: ZipProvider allows creating entries beneath non-directory parents

Abierto
#65,828 0 comentarios 1 reacción 1 asignado Ver en GitHub

@trivikr ya está trabajando en esto.

Desde el 5/9/2026.

vfs
Lenguaje dominante
JavaScript
Estrellas
122k
Forks
37.3k
Merge medio
4 d 2 h
PR fusionados (30 d)
283

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.