vfs: ZipProvider allows creating entries beneath non-directory parents
Ouverte
@trivikr y travaille déjà.
Depuis le 5/9/2026.
vfs
- Langage dominant
- JavaScript
- Étoiles
- 122k
- Forks
- 37.3k
- Merge moyen
- 4 j 2 h
- PR mergées (30 j)
- 283
Description
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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Évaluation
Cette issue n'a pas encore été évaluée.