From 31b51c5646de729c691c2dec94f73988f6dd7d8a Mon Sep 17 00:00:00 2001 From: Darcy Clarke Date: Mon, 14 Nov 2022 19:18:30 -0500 Subject: [PATCH] tar-stream@2.2.0 --- node_modules/tar-stream/README.md | 2 +- node_modules/tar-stream/extract.js | 4 ++-- node_modules/tar-stream/headers.js | 35 +++++++++++++--------------- node_modules/tar-stream/pack.js | 5 ++-- node_modules/tar-stream/package.json | 33 +++++++++++++++----------- package-lock.json | 21 +++++++++++++---- package.json | 2 +- 7 files changed, 60 insertions(+), 42 deletions(-) diff --git a/node_modules/tar-stream/README.md b/node_modules/tar-stream/README.md index 96abbca1b841e..2679d9d0184d8 100644 --- a/node_modules/tar-stream/README.md +++ b/node_modules/tar-stream/README.md @@ -86,7 +86,7 @@ Most of these values can be found by stat'ing a file. { name: 'path/to/this/entry.txt', size: 1314, // entry size. defaults to 0 - mode: 0644, // entry mode. defaults to to 0755 for dirs and 0644 otherwise + mode: 0o644, // entry mode. defaults to to 0o755 for dirs and 0o644 otherwise mtime: new Date(), // last modified date for entry. defaults to now. type: 'file', // type of entry. defaults to file. can be: // file | link | symlink | directory | block-device diff --git a/node_modules/tar-stream/extract.js b/node_modules/tar-stream/extract.js index 1a2a4450e7974..11b13b7c7d871 100644 --- a/node_modules/tar-stream/extract.js +++ b/node_modules/tar-stream/extract.js @@ -29,7 +29,7 @@ var mixinPax = function (header, pax) { var Source = function (self, offset) { this._parent = self this.offset = offset - PassThrough.call(this) + PassThrough.call(this, { autoDestroy: false }) } util.inherits(Source, PassThrough) @@ -120,7 +120,7 @@ var Extract = function (opts) { var offset = self._offset var header try { - header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding) + header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding, opts.allowUnknownFormat) } catch (err) { self.emit('error', err) } diff --git a/node_modules/tar-stream/headers.js b/node_modules/tar-stream/headers.js index fe7fd36735c8d..aba4ca49a66b3 100644 --- a/node_modules/tar-stream/headers.js +++ b/node_modules/tar-stream/headers.js @@ -112,16 +112,11 @@ function parse256 (buf) { else return null // build up a base-256 tuple from the least sig to the highest - var zero = false var tuple = [] for (var i = buf.length - 1; i > 0; i--) { var byte = buf[i] if (positive) tuple.push(byte) - else if (zero && byte === 0) tuple.push(0) - else if (zero) { - zero = false - tuple.push(0x100 - byte) - } else tuple.push(0xFF - byte) + else tuple.push(0xFF - byte) } var sum = 0 @@ -242,7 +237,7 @@ exports.encode = function (opts) { return buf } -exports.decode = function (buf, filenameEncoding) { +exports.decode = function (buf, filenameEncoding, allowUnknownFormat) { var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET var name = decodeStr(buf, 0, 100, filenameEncoding) @@ -275,24 +270,26 @@ exports.decode = function (buf, filenameEncoding) { // 'gnu'/'oldgnu' format. Similar to ustar, but has support for incremental and // multi-volume tarballs. } else { - throw new Error('Invalid tar header: unknown format.') + if (!allowUnknownFormat) { + throw new Error('Invalid tar header: unknown format.') + } } // to support old tar versions that use trailing / to indicate dirs if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5 return { - name: name, - mode: mode, - uid: uid, - gid: gid, - size: size, + name, + mode, + uid, + gid, + size, mtime: new Date(1000 * mtime), - type: type, - linkname: linkname, - uname: uname, - gname: gname, - devmajor: devmajor, - devminor: devminor + type, + linkname, + uname, + gname, + devmajor, + devminor } } diff --git a/node_modules/tar-stream/pack.js b/node_modules/tar-stream/pack.js index ba4eece28408b..f1da3b730d64c 100644 --- a/node_modules/tar-stream/pack.js +++ b/node_modules/tar-stream/pack.js @@ -128,9 +128,10 @@ Pack.prototype.entry = function (header, buffer, callback) { if (Buffer.isBuffer(buffer)) { header.size = buffer.length this._encode(header) - this.push(buffer) + var ok = this.push(buffer) overflow(self, header.size) - process.nextTick(callback) + if (ok) process.nextTick(callback) + else this._drain = callback return new Void() } diff --git a/node_modules/tar-stream/package.json b/node_modules/tar-stream/package.json index 9acb919dca310..83f70d2873b79 100644 --- a/node_modules/tar-stream/package.json +++ b/node_modules/tar-stream/package.json @@ -1,28 +1,32 @@ { - "_from": "tar-stream@2.1.0", - "_id": "tar-stream@2.1.0", + "_from": "tar-stream@2.2.0", + "_id": "tar-stream@2.2.0", "_inBundle": false, - "_integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==", + "_integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "_location": "/tar-stream", - "_phantomChildren": {}, + "_phantomChildren": { + "buffer": "5.7.1", + "inherits": "2.0.4", + "readable-stream": "3.6.0" + }, "_requested": { "type": "version", "registry": true, - "raw": "tar-stream@2.1.0", + "raw": "tar-stream@2.2.0", "name": "tar-stream", "escapedName": "tar-stream", - "rawSpec": "2.1.0", + "rawSpec": "2.2.0", "saveSpec": null, - "fetchSpec": "2.1.0" + "fetchSpec": "2.2.0" }, "_requiredBy": [ "#DEV:/", "#USER" ], - "_resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz", - "_shasum": "d1aaa3661f05b38b5acc9b7020efdca5179a2cc3", - "_spec": "tar-stream@2.1.0", - "_where": "/Users/isaacs/dev/npm/cli", + "_resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "_shasum": "acad84c284136b060dc3faa64474aa9aebd77287", + "_spec": "tar-stream@2.2.0", + "_where": "/Users/darcyclarke/Documents/Repos/npm/v6", "author": { "name": "Mathias Buus", "email": "mathiasbuus@gmail.com" @@ -32,7 +36,7 @@ }, "bundleDependencies": false, "dependencies": { - "bl": "^3.0.0", + "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", @@ -48,6 +52,9 @@ "directories": { "test": "test" }, + "engines": { + "node": ">=6" + }, "files": [ "*.js", "LICENSE" @@ -80,5 +87,5 @@ "test": "standard && tape test/extract.js test/pack.js", "test-all": "standard && tape test/*.js" }, - "version": "2.1.0" + "version": "2.2.0" } diff --git a/package-lock.json b/package-lock.json index 7fd8d3128d7e5..452ccae6f698e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7574,16 +7574,29 @@ } }, "tar-stream": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.0.tgz", - "integrity": "sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", "dev": true, "requires": { - "bl": "^3.0.0", + "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" + }, + "dependencies": { + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + } } }, "term-size": { diff --git a/package.json b/package.json index 3027661e9a02e..6f610f05b2cf2 100644 --- a/package.json +++ b/package.json @@ -291,7 +291,7 @@ "standard": "^11.0.1", "tacks": "^1.3.0", "tap": "^12.7.0", - "tar-stream": "^2.1.0", + "tar-stream": "^2.2.0", "yaml": "^1.10.0" }, "scripts": {