mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-07 14:38:32 -05:00
6
.changeset/orange-garlics-compete.md
Normal file
6
.changeset/orange-garlics-compete.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/cafs": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Don't fail when a package is archived in a tarball with malformed tar headers [#5362](https://github.com/pnpm/pnpm/issues/5362).
|
||||
@@ -11,7 +11,7 @@ export async function addFilesFromTarball (
|
||||
manifest?: DeferredManifestPromise
|
||||
): Promise<FilesIndex> {
|
||||
const ignore = _ignore ?? (() => false)
|
||||
const extract = tar.extract()
|
||||
const extract = tar.extract({ allowUnknownFormat: true })
|
||||
const filesIndex: FilesIndex = {}
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
extract.on('entry', (header, fileStream, next) => {
|
||||
|
||||
BIN
store/cafs/test/fixtures/jquery.dirtyforms-2.0.0.tgz
vendored
Normal file
BIN
store/cafs/test/fixtures/jquery.dirtyforms-2.0.0.tgz
vendored
Normal file
Binary file not shown.
@@ -74,3 +74,11 @@ test('file names are normalized when unpacking a tarball', async () => {
|
||||
'package.json',
|
||||
])
|
||||
})
|
||||
|
||||
test('broken magic in tarball headers is handled gracefully', async () => {
|
||||
const dest = tempy.directory()
|
||||
const cafs = createCafs(dest)
|
||||
await cafs.addFilesFromTarball(
|
||||
createReadStream(path.join(__dirname, 'fixtures/jquery.dirtyforms-2.0.0.tgz'))
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user