diff options
author | Rebecca Turner <me@re-becca.org> | 2018-06-07 20:54:45 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2018-06-07 20:54:46 +0300 |
commit | bae657c280f6ea8e677509a9576e1b47c65c5441 (patch) | |
tree | a9fa750c2812102ff65c0e483cd67bfb011a6325 /node_modules/tar | |
parent | b7cc48deee45da1feab49aa1dd4d92e33c9bcac8 (diff) |
tar@4.4.4
Diffstat (limited to 'node_modules/tar')
-rw-r--r-- | node_modules/tar/README.md | 4 | ||||
-rw-r--r-- | node_modules/tar/lib/header.js | 2 | ||||
-rw-r--r-- | node_modules/tar/lib/mode-fix.js | 14 | ||||
-rw-r--r-- | node_modules/tar/lib/pack.js | 1 | ||||
-rw-r--r-- | node_modules/tar/lib/write-entry.js | 17 | ||||
-rw-r--r-- | node_modules/tar/package.json | 28 |
6 files changed, 45 insertions, 21 deletions
diff --git a/node_modules/tar/README.md b/node_modules/tar/README.md index ea98e0b21..fc55bc36f 100644 --- a/node_modules/tar/README.md +++ b/node_modules/tar/README.md @@ -534,7 +534,6 @@ The following options are supported: - `mtime` Set to a `Date` object to force a specific `mtime` for everything added to the archive. Overridden by `noMtime`. - #### add(path) Adds an entry to the archive. Returns the Pack stream. @@ -784,6 +783,9 @@ The following options are supported: - `noMtime` Set to true to omit writing `mtime` values for entries. Note that this prevents using other mtime-based features like `tar.update` or the `keepNewer` option with the resulting tar archive. +- `umask` Set to restrict the modes on the entries in the archive, + somewhat like how umask works on file creation. Defaults to + `process.umask()` on unix systems, or `0o22` on Windows. #### warn(message, data) diff --git a/node_modules/tar/lib/header.js b/node_modules/tar/lib/header.js index 31cde8b5c..cad4aec25 100644 --- a/node_modules/tar/lib/header.js +++ b/node_modules/tar/lib/header.js @@ -6,7 +6,7 @@ const Buffer = require('./buffer.js') const types = require('./types.js') -const pathModule = require('path') +const pathModule = require('path').posix const large = require('./large-numbers.js') const TYPE = Symbol('type') diff --git a/node_modules/tar/lib/mode-fix.js b/node_modules/tar/lib/mode-fix.js new file mode 100644 index 000000000..3363a3b15 --- /dev/null +++ b/node_modules/tar/lib/mode-fix.js @@ -0,0 +1,14 @@ +'use strict' +module.exports = (mode, isDir) => { + mode &= 0o7777 + // if dirs are readable, then they should be listable + if (isDir) { + if (mode & 0o400) + mode |= 0o100 + if (mode & 0o40) + mode |= 0o10 + if (mode & 0o4) + mode |= 0o1 + } + return mode +} diff --git a/node_modules/tar/lib/pack.js b/node_modules/tar/lib/pack.js index 180e332e9..857cea910 100644 --- a/node_modules/tar/lib/pack.js +++ b/node_modules/tar/lib/pack.js @@ -71,6 +71,7 @@ const Pack = warner(class Pack extends MiniPass { this.linkCache = opt.linkCache || new Map() this.statCache = opt.statCache || new Map() this.readdirCache = opt.readdirCache || new Map() + this[WRITEENTRYCLASS] = WriteEntry if (typeof opt.onwarn === 'function') this.on('warn', opt.onwarn) diff --git a/node_modules/tar/lib/write-entry.js b/node_modules/tar/lib/write-entry.js index 7b43ebcd3..3a4c99b9e 100644 --- a/node_modules/tar/lib/write-entry.js +++ b/node_modules/tar/lib/write-entry.js @@ -23,9 +23,12 @@ const ONREADLINK = Symbol('onreadlink') const OPENFILE = Symbol('openfile') const ONOPENFILE = Symbol('onopenfile') const CLOSE = Symbol('close') +const MODE = Symbol('mode') const warner = require('./warn-mixin.js') const winchars = require('./winchars.js') +const modeFix = require('./mode-fix.js') + const WriteEntry = warner(class WriteEntry extends MiniPass { constructor (p, opt) { opt = opt || {} @@ -104,6 +107,10 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { } } + [MODE] (mode) { + return modeFix(mode, this.type === 'Directory') + } + [HEADER] () { if (this.type === 'Directory' && this.portable) this.noMtime = true @@ -113,7 +120,7 @@ const WriteEntry = warner(class WriteEntry extends MiniPass { linkpath: this.linkpath, // only the permissions and setuid/setgid/sticky bitflags // not the higher-order bits that specify file type - mode: this.stat.mode & 0o7777, + mode: this[MODE](this.stat.mode), uid: this.portable ? null : this.stat.uid, gid: this.portable ? null : this.stat.gid, size: this.stat.size, @@ -312,9 +319,7 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { this.noMtime = true this.path = readEntry.path - this.mode = readEntry.mode - if (this.mode) - this.mode = this.mode & 0o7777 + this.mode = this[MODE](readEntry.mode) this.uid = this.portable ? null : readEntry.uid this.gid = this.portable ? null : readEntry.gid this.uname = this.portable ? null : readEntry.uname @@ -376,6 +381,10 @@ const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { readEntry.pipe(this) } + [MODE] (mode) { + return modeFix(mode, this.type === 'Directory') + } + write (data) { const writeLen = data.length if (writeLen > this.blockRemain) diff --git a/node_modules/tar/package.json b/node_modules/tar/package.json index b3a1816bf..a4b9e0053 100644 --- a/node_modules/tar/package.json +++ b/node_modules/tar/package.json @@ -1,32 +1,28 @@ { - "_args": [ - [ - "tar@4.4.3", - "/Users/rebecca/code/npm" - ] - ], - "_from": "tar@4.4.3", - "_id": "tar@4.4.3", + "_from": "tar@4.4.4", + "_id": "tar@4.4.4", "_inBundle": false, - "_integrity": "sha512-LBw+tcY+/iCCTvF4i3SjqKWIgixSs/dB+Elg3BaY0MXh03D9jWclYskg3BiOkgg414NqpFI3nRgr2Qnw5jJs7Q==", + "_integrity": "sha512-mq9ixIYfNF9SK0IS/h2HKMu8Q2iaCuhDDsZhdEag/FHv8fOaYld4vN7ouMgcSSt5WKZzPs8atclTcJm36OTh4w==", "_location": "/tar", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "tar@4.4.3", + "raw": "tar@4.4.4", "name": "tar", "escapedName": "tar", - "rawSpec": "4.4.3", + "rawSpec": "4.4.4", "saveSpec": null, - "fetchSpec": "4.4.3" + "fetchSpec": "4.4.4" }, "_requiredBy": [ + "#USER", "/", "/pacote" ], - "_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.3.tgz", - "_spec": "4.4.3", + "_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.4.tgz", + "_shasum": "ec8409fae9f665a4355cc3b4087d0820232bb8cd", + "_spec": "tar@4.4.4", "_where": "/Users/rebecca/code/npm", "author": { "name": "Isaac Z. Schlueter", @@ -36,6 +32,7 @@ "bugs": { "url": "https://github.com/npm/node-tar/issues" }, + "bundleDependencies": false, "dependencies": { "chownr": "^1.0.1", "fs-minipass": "^1.2.5", @@ -45,6 +42,7 @@ "safe-buffer": "^5.1.2", "yallist": "^3.0.2" }, + "deprecated": false, "description": "tar for node", "devDependencies": { "chmodr": "^1.0.2", @@ -78,5 +76,5 @@ "preversion": "npm test", "test": "tap test/*.js --100 -J --coverage-report=text -c" }, - "version": "4.4.3" + "version": "4.4.4" } |