step-node-agent 3.16.3 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/asn1/Jenkinsfile +65 -0
- package/node_modules/asn1/package.json +5 -5
- package/node_modules/body-parser/HISTORY.md +15 -0
- package/node_modules/body-parser/README.md +25 -12
- package/node_modules/body-parser/package.json +23 -23
- package/node_modules/bytes/History.md +5 -0
- package/node_modules/bytes/Readme.md +42 -16
- package/node_modules/bytes/index.js +5 -1
- package/node_modules/bytes/package.json +9 -8
- package/node_modules/content-disposition/HISTORY.md +5 -0
- package/node_modules/content-disposition/README.md +3 -9
- package/node_modules/content-disposition/index.js +1 -1
- package/node_modules/content-disposition/package.json +16 -16
- package/node_modules/cookie/HISTORY.md +5 -0
- package/node_modules/cookie/README.md +4 -0
- package/node_modules/cookie/index.js +5 -1
- package/node_modules/cookie/package.json +11 -11
- package/node_modules/express/History.md +33 -0
- package/node_modules/express/Readme.md +8 -5
- package/node_modules/express/lib/application.js +1 -1
- package/node_modules/express/lib/request.js +1 -1
- package/node_modules/express/lib/response.js +16 -11
- package/node_modules/express/lib/router/index.js +6 -0
- package/node_modules/express/lib/utils.js +2 -6
- package/node_modules/express/package.json +26 -25
- package/node_modules/glob/README.md +3 -0
- package/node_modules/glob/common.js +2 -0
- package/node_modules/glob/glob.js +4 -5
- package/node_modules/glob/package.json +5 -4
- package/node_modules/glob/sync.js +4 -5
- package/node_modules/graceful-fs/README.md +11 -1
- package/node_modules/graceful-fs/graceful-fs.js +105 -49
- package/node_modules/graceful-fs/package.json +4 -4
- package/node_modules/graceful-fs/polyfills.js +4 -2
- package/node_modules/http-errors/HISTORY.md +16 -0
- package/node_modules/http-errors/README.md +12 -6
- package/node_modules/http-errors/index.js +35 -2
- package/node_modules/http-errors/package.json +19 -19
- package/node_modules/inherits/inherits.js +2 -0
- package/node_modules/inherits/inherits_browser.js +18 -14
- package/node_modules/inherits/package.json +6 -6
- package/node_modules/is-callable/.editorconfig +5 -0
- package/node_modules/is-callable/.nycrc +0 -4
- package/node_modules/is-callable/CHANGELOG.md +14 -0
- package/node_modules/is-callable/README.md +14 -15
- package/node_modules/is-callable/index.js +1 -1
- package/node_modules/is-callable/package.json +20 -28
- package/node_modules/is-callable/test/index.js +22 -50
- package/node_modules/is-core-module/.eslintrc +0 -1
- package/node_modules/is-core-module/CHANGELOG.md +37 -0
- package/node_modules/is-core-module/core.json +65 -61
- package/node_modules/is-core-module/index.js +1 -1
- package/node_modules/is-core-module/package.json +11 -10
- package/node_modules/is-core-module/test/index.js +23 -1
- package/node_modules/json-schema/LICENSE +195 -0
- package/node_modules/json-schema/README.md +2 -4
- package/node_modules/json-schema/lib/links.js +1 -2
- package/node_modules/json-schema/lib/validate.js +7 -9
- package/node_modules/json-schema/package.json +8 -14
- package/node_modules/jsprim/CHANGES.md +4 -0
- package/node_modules/jsprim/package.json +8 -8
- package/node_modules/mime-db/HISTORY.md +19 -0
- package/node_modules/mime-db/db.json +93 -1
- package/node_modules/mime-db/package.json +10 -10
- package/node_modules/mime-types/HISTORY.md +20 -3
- package/node_modules/mime-types/package.json +10 -10
- package/node_modules/npm/CHANGELOG.md +30 -0
- package/node_modules/npm/docs/public/cli-commands/npm/index.html +3 -3
- package/node_modules/npm/docs/public/cli-commands/npm-access/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-adduser/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-audit/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-bin/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-bugs/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-build/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-bundle/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-cache/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-ci/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-completion/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-config/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-dedupe/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-deprecate/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-dist-tag/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-docs/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-doctor/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-edit/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-explore/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-fund/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-help/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-help-search/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-hook/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-init/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-install/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-install-ci-test/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-install-test/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-link/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-logout/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-ls/index.html +3 -3
- package/node_modules/npm/docs/public/cli-commands/npm-org/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-outdated/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-owner/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-pack/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-ping/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-prefix/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-profile/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-prune/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-publish/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-rebuild/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-repo/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-restart/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-root/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-run-script/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-search/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-shrinkwrap/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-star/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-stars/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-start/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-stop/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-team/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-test/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-token/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-uninstall/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-unpublish/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-update/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-version/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-view/index.html +2 -2
- package/node_modules/npm/docs/public/cli-commands/npm-whoami/index.html +2 -2
- package/node_modules/npm/docs/public/configuring-npm/folders/index.html +2 -2
- package/node_modules/npm/docs/public/configuring-npm/install/index.html +2 -2
- package/node_modules/npm/docs/public/configuring-npm/npmrc/index.html +2 -2
- package/node_modules/npm/docs/public/configuring-npm/package-json/index.html +2 -2
- package/node_modules/npm/docs/public/configuring-npm/package-lock-json/index.html +2 -2
- package/node_modules/npm/docs/public/configuring-npm/package-locks/index.html +2 -2
- package/node_modules/npm/docs/public/configuring-npm/shrinkwrap-json/index.html +2 -2
- package/node_modules/npm/docs/public/index.html +1 -1
- package/node_modules/npm/docs/public/using-npm/config/index.html +2 -2
- package/node_modules/npm/docs/public/using-npm/developers/index.html +2 -2
- package/node_modules/npm/docs/public/using-npm/disputes/index.html +2 -2
- package/node_modules/npm/docs/public/using-npm/orgs/index.html +2 -2
- package/node_modules/npm/docs/public/using-npm/registry/index.html +2 -2
- package/node_modules/npm/docs/public/using-npm/removal/index.html +2 -2
- package/node_modules/npm/docs/public/using-npm/scope/index.html +2 -2
- package/node_modules/npm/docs/public/using-npm/scripts/index.html +2 -2
- package/node_modules/npm/docs/public/using-npm/semver/index.html +2 -2
- package/node_modules/npm/lib/auth/legacy.js +1 -1
- package/node_modules/npm/lib/profile.js +2 -2
- package/node_modules/npm/man/man1/npm-README.1 +1 -1
- package/node_modules/npm/man/man1/npm-access.1 +1 -1
- package/node_modules/npm/man/man1/npm-adduser.1 +1 -1
- package/node_modules/npm/man/man1/npm-audit.1 +1 -1
- package/node_modules/npm/man/man1/npm-bin.1 +1 -1
- package/node_modules/npm/man/man1/npm-bugs.1 +1 -1
- package/node_modules/npm/man/man1/npm-build.1 +1 -1
- package/node_modules/npm/man/man1/npm-bundle.1 +1 -1
- package/node_modules/npm/man/man1/npm-cache.1 +1 -1
- package/node_modules/npm/man/man1/npm-ci.1 +1 -1
- package/node_modules/npm/man/man1/npm-completion.1 +1 -1
- package/node_modules/npm/man/man1/npm-config.1 +1 -1
- package/node_modules/npm/man/man1/npm-dedupe.1 +1 -1
- package/node_modules/npm/man/man1/npm-deprecate.1 +1 -1
- package/node_modules/npm/man/man1/npm-dist-tag.1 +1 -1
- package/node_modules/npm/man/man1/npm-docs.1 +1 -1
- package/node_modules/npm/man/man1/npm-doctor.1 +1 -1
- package/node_modules/npm/man/man1/npm-edit.1 +1 -1
- package/node_modules/npm/man/man1/npm-explore.1 +1 -1
- package/node_modules/npm/man/man1/npm-fund.1 +1 -1
- package/node_modules/npm/man/man1/npm-help-search.1 +1 -1
- package/node_modules/npm/man/man1/npm-help.1 +1 -1
- package/node_modules/npm/man/man1/npm-hook.1 +1 -1
- package/node_modules/npm/man/man1/npm-init.1 +1 -1
- package/node_modules/npm/man/man1/npm-install-ci-test.1 +1 -1
- package/node_modules/npm/man/man1/npm-install-test.1 +1 -1
- package/node_modules/npm/man/man1/npm-install.1 +1 -1
- package/node_modules/npm/man/man1/npm-link.1 +1 -1
- package/node_modules/npm/man/man1/npm-logout.1 +1 -1
- package/node_modules/npm/man/man1/npm-ls.1 +2 -2
- package/node_modules/npm/man/man1/npm-org.1 +1 -1
- package/node_modules/npm/man/man1/npm-outdated.1 +1 -1
- package/node_modules/npm/man/man1/npm-owner.1 +1 -1
- package/node_modules/npm/man/man1/npm-pack.1 +1 -1
- package/node_modules/npm/man/man1/npm-ping.1 +1 -1
- package/node_modules/npm/man/man1/npm-prefix.1 +1 -1
- package/node_modules/npm/man/man1/npm-profile.1 +1 -1
- package/node_modules/npm/man/man1/npm-prune.1 +1 -1
- package/node_modules/npm/man/man1/npm-publish.1 +1 -1
- package/node_modules/npm/man/man1/npm-rebuild.1 +1 -1
- package/node_modules/npm/man/man1/npm-repo.1 +1 -1
- package/node_modules/npm/man/man1/npm-restart.1 +1 -1
- package/node_modules/npm/man/man1/npm-root.1 +1 -1
- package/node_modules/npm/man/man1/npm-run-script.1 +1 -1
- package/node_modules/npm/man/man1/npm-search.1 +1 -1
- package/node_modules/npm/man/man1/npm-shrinkwrap.1 +1 -1
- package/node_modules/npm/man/man1/npm-star.1 +1 -1
- package/node_modules/npm/man/man1/npm-stars.1 +1 -1
- package/node_modules/npm/man/man1/npm-start.1 +1 -1
- package/node_modules/npm/man/man1/npm-stop.1 +1 -1
- package/node_modules/npm/man/man1/npm-team.1 +1 -1
- package/node_modules/npm/man/man1/npm-test.1 +1 -1
- package/node_modules/npm/man/man1/npm-token.1 +1 -1
- package/node_modules/npm/man/man1/npm-uninstall.1 +1 -1
- package/node_modules/npm/man/man1/npm-unpublish.1 +1 -1
- package/node_modules/npm/man/man1/npm-update.1 +1 -1
- package/node_modules/npm/man/man1/npm-version.1 +1 -1
- package/node_modules/npm/man/man1/npm-view.1 +1 -1
- package/node_modules/npm/man/man1/npm-whoami.1 +1 -1
- package/node_modules/npm/man/man1/npm.1 +2 -2
- package/node_modules/npm/man/man5/folders.5 +1 -1
- package/node_modules/npm/man/man5/install.5 +1 -1
- package/node_modules/npm/man/man5/npmrc.5 +1 -1
- package/node_modules/npm/man/man5/package-json.5 +1 -1
- package/node_modules/npm/man/man5/package-lock-json.5 +1 -1
- package/node_modules/npm/man/man5/package-locks.5 +1 -1
- package/node_modules/npm/man/man5/shrinkwrap-json.5 +1 -1
- package/node_modules/npm/man/man7/config.7 +1 -1
- package/node_modules/npm/man/man7/developers.7 +1 -1
- package/node_modules/npm/man/man7/disputes.7 +1 -1
- package/node_modules/npm/man/man7/orgs.7 +1 -1
- package/node_modules/npm/man/man7/registry.7 +1 -1
- package/node_modules/npm/man/man7/removal.7 +1 -1
- package/node_modules/npm/man/man7/scope.7 +1 -1
- package/node_modules/npm/man/man7/scripts.7 +1 -1
- package/node_modules/npm/man/man7/semver.7 +1 -1
- package/node_modules/npm/node_modules/json-schema/LICENSE +195 -0
- package/node_modules/npm/node_modules/json-schema/README.md +2 -4
- package/node_modules/npm/node_modules/json-schema/lib/links.js +1 -2
- package/node_modules/npm/node_modules/json-schema/lib/validate.js +7 -9
- package/node_modules/npm/node_modules/json-schema/package.json +16 -22
- package/node_modules/npm/node_modules/jsprim/CHANGES.md +4 -0
- package/node_modules/npm/node_modules/jsprim/CONTRIBUTING.md +19 -0
- package/node_modules/npm/node_modules/jsprim/package.json +16 -16
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.pyc +0 -0
- package/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.pyc +0 -0
- package/node_modules/npm/node_modules/path-parse/index.js +17 -35
- package/node_modules/npm/node_modules/path-parse/package.json +14 -17
- package/node_modules/npm/node_modules/tar/lib/extract.js +4 -3
- package/node_modules/npm/node_modules/tar/lib/list.js +4 -3
- package/node_modules/npm/node_modules/tar/lib/mkdir.js +55 -48
- package/node_modules/npm/node_modules/tar/lib/normalize-windows-path.js +8 -0
- package/node_modules/npm/node_modules/tar/lib/pack.js +8 -18
- package/node_modules/npm/node_modules/tar/lib/path-reservations.js +149 -0
- package/node_modules/npm/node_modules/tar/lib/read-entry.js +4 -3
- package/node_modules/npm/node_modules/tar/lib/replace.js +2 -1
- package/node_modules/npm/node_modules/tar/lib/strip-absolute-path.js +24 -0
- package/node_modules/npm/node_modules/tar/lib/strip-trailing-slashes.js +24 -0
- package/node_modules/npm/node_modules/tar/lib/unpack.js +321 -96
- package/node_modules/npm/node_modules/tar/lib/write-entry.js +178 -82
- package/node_modules/npm/node_modules/tar/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/npm/node_modules/tar/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/npm/node_modules/tar/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/npm/node_modules/tar/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/npm/node_modules/tar/node_modules/safe-buffer/package.json +77 -0
- package/node_modules/npm/node_modules/tar/node_modules/yallist/LICENSE +15 -0
- package/node_modules/npm/node_modules/tar/node_modules/yallist/README.md +204 -0
- package/node_modules/npm/node_modules/tar/node_modules/yallist/iterator.js +8 -0
- package/node_modules/npm/node_modules/tar/node_modules/yallist/package.json +63 -0
- package/node_modules/npm/node_modules/tar/node_modules/yallist/yallist.js +426 -0
- package/node_modules/npm/node_modules/tar/package.json +29 -26
- package/node_modules/npm/package.json +6 -5
- package/node_modules/qs/.editorconfig +9 -0
- package/node_modules/qs/.eslintignore +2 -1
- package/node_modules/qs/.eslintrc +15 -1
- package/node_modules/qs/.github/FUNDING.yml +12 -0
- package/node_modules/qs/.nycrc +13 -0
- package/node_modules/qs/CHANGELOG.md +103 -0
- package/node_modules/qs/LICENSE.md +29 -0
- package/node_modules/qs/README.md +34 -0
- package/node_modules/qs/dist/qs.js +117 -67
- package/node_modules/qs/lib/formats.js +9 -4
- package/node_modules/qs/lib/parse.js +29 -14
- package/node_modules/qs/lib/stringify.js +55 -46
- package/node_modules/qs/lib/utils.js +23 -2
- package/node_modules/qs/package.json +31 -20
- package/node_modules/qs/test/parse.js +97 -1
- package/node_modules/qs/test/stringify.js +115 -1
- package/node_modules/qs/test/utils.js +1 -1
- package/node_modules/raw-body/HISTORY.md +14 -0
- package/node_modules/raw-body/README.md +3 -5
- package/node_modules/raw-body/package.json +21 -21
- package/node_modules/request/node_modules/qs/.editorconfig +14 -1
- package/node_modules/request/node_modules/qs/.eslintrc +21 -3
- package/node_modules/request/node_modules/qs/.github/FUNDING.yml +12 -0
- package/node_modules/request/node_modules/qs/.nycrc +13 -0
- package/node_modules/request/node_modules/qs/CHANGELOG.md +24 -0
- package/node_modules/request/node_modules/qs/LICENSE.md +29 -0
- package/node_modules/request/node_modules/qs/README.md +54 -19
- package/node_modules/request/node_modules/qs/bower.json +21 -0
- package/node_modules/request/node_modules/qs/component.json +15 -0
- package/node_modules/request/node_modules/qs/dist/qs.js +35 -25
- package/node_modules/request/node_modules/qs/lib/formats.js +1 -1
- package/node_modules/request/node_modules/qs/lib/parse.js +6 -5
- package/node_modules/request/node_modules/qs/lib/stringify.js +21 -14
- package/node_modules/request/node_modules/qs/lib/utils.js +7 -5
- package/node_modules/request/node_modules/qs/package.json +21 -19
- package/node_modules/request/node_modules/qs/test/parse.js +79 -4
- package/node_modules/request/node_modules/qs/test/stringify.js +45 -0
- package/node_modules/request/node_modules/qs/test/utils.js +31 -0
- package/node_modules/resolve/.eslintrc +34 -8
- package/node_modules/resolve/.github/FUNDING.yml +12 -0
- package/node_modules/resolve/appveyor.yml +4 -2
- package/node_modules/resolve/async.js +3 -0
- package/node_modules/resolve/bin/resolve +50 -0
- package/node_modules/resolve/lib/async.js +10 -1
- package/node_modules/resolve/lib/core.js +1 -2
- package/node_modules/resolve/lib/core.json +85 -16
- package/node_modules/resolve/lib/homedir.js +24 -0
- package/node_modules/resolve/lib/node-modules-paths.js +1 -1
- package/node_modules/resolve/lib/sync.js +14 -5
- package/node_modules/resolve/package.json +26 -15
- package/node_modules/resolve/readme.markdown +35 -13
- package/node_modules/resolve/sync.js +3 -0
- package/node_modules/resolve/test/home_paths.js +127 -0
- package/node_modules/resolve/test/home_paths_sync.js +114 -0
- package/node_modules/resolve/test/mock_sync.js +2 -4
- package/node_modules/resolve/test/node_path.js +1 -1
- package/node_modules/resolve/test/resolver/invalid_main/package.json +1 -1
- package/node_modules/resolve/test/resolver/malformed_package_json/index.js +0 -0
- package/node_modules/resolve/test/resolver/malformed_package_json/package.json +1 -0
- package/node_modules/resolve/test/resolver.js +99 -3
- package/node_modules/resolve/test/resolver_sync.js +310 -23
- package/node_modules/safe-buffer/index.js +3 -0
- package/node_modules/safe-buffer/package.json +21 -7
- package/node_modules/send/HISTORY.md +10 -0
- package/node_modules/send/README.md +4 -6
- package/node_modules/send/index.js +7 -3
- package/node_modules/send/node_modules/ms/index.js +3 -3
- package/node_modules/send/node_modules/ms/license.md +1 -1
- package/node_modules/send/node_modules/ms/package.json +8 -7
- package/node_modules/send/node_modules/ms/readme.md +1 -2
- package/node_modules/send/package.json +19 -19
- package/node_modules/serve-static/HISTORY.md +8 -0
- package/node_modules/serve-static/README.md +9 -11
- package/node_modules/serve-static/package.json +19 -19
- package/node_modules/setprototypeof/README.md +1 -1
- package/node_modules/setprototypeof/index.js +1 -1
- package/node_modules/setprototypeof/package.json +9 -7
- package/node_modules/shelljs/package.json +4 -4
- package/node_modules/shelljs/src/exec.js +19 -1
- package/node_modules/signal-exit/README.md +1 -1
- package/node_modules/signal-exit/index.js +167 -130
- package/node_modules/signal-exit/package.json +13 -13
- package/node_modules/sshpk/Jenkinsfile +86 -0
- package/node_modules/sshpk/lib/formats/putty.js +99 -4
- package/node_modules/sshpk/lib/private-key.js +1 -0
- package/node_modules/sshpk/package.json +4 -4
- package/node_modules/supports-preserve-symlinks-flag/.eslintrc +14 -0
- package/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml +12 -0
- package/node_modules/supports-preserve-symlinks-flag/.nycrc +9 -0
- package/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md +22 -0
- package/node_modules/supports-preserve-symlinks-flag/LICENSE +21 -0
- package/node_modules/supports-preserve-symlinks-flag/README.md +42 -0
- package/node_modules/supports-preserve-symlinks-flag/browser.js +3 -0
- package/node_modules/supports-preserve-symlinks-flag/index.js +9 -0
- package/node_modules/supports-preserve-symlinks-flag/package.json +74 -0
- package/node_modules/supports-preserve-symlinks-flag/test/index.js +29 -0
- package/node_modules/toidentifier/HISTORY.md +9 -0
- package/node_modules/toidentifier/README.md +3 -3
- package/node_modules/toidentifier/index.js +2 -0
- package/node_modules/toidentifier/package.json +19 -15
- package/node_modules/underscore/amd/_collectNonEnumProps.js +1 -1
- package/node_modules/underscore/amd/_setup.js +1 -1
- package/node_modules/underscore/amd/sample.js +2 -2
- package/node_modules/underscore/cjs/_collectNonEnumProps.js +1 -1
- package/node_modules/underscore/cjs/_setup.js +1 -1
- package/node_modules/underscore/cjs/sample.js +2 -2
- package/node_modules/underscore/modules/_collectNonEnumProps.js +1 -1
- package/node_modules/underscore/modules/_setup.js +1 -1
- package/node_modules/underscore/modules/index.js +1 -1
- package/node_modules/underscore/modules/sample.js +2 -2
- package/node_modules/underscore/package.json +4 -4
- package/node_modules/underscore/underscore-esm-min.js +2 -2
- package/node_modules/underscore/underscore-esm-min.js.map +1 -1
- package/node_modules/underscore/underscore-esm.js +17 -17
- package/node_modules/underscore/underscore-esm.js.map +1 -1
- package/node_modules/underscore/underscore-min.js +2 -2
- package/node_modules/underscore/underscore-min.js.map +1 -1
- package/node_modules/underscore/underscore-node-f.cjs +17 -17
- package/node_modules/underscore/underscore-node-f.cjs.map +1 -1
- package/node_modules/underscore/underscore-node.cjs +1 -1
- package/node_modules/underscore/underscore-node.mjs +1 -1
- package/node_modules/underscore/underscore-umd-min.js +2 -2
- package/node_modules/underscore/underscore-umd-min.js.map +1 -1
- package/node_modules/underscore/underscore-umd.js +17 -17
- package/node_modules/underscore/underscore-umd.js.map +1 -1
- package/node_modules/underscore/underscore.js +17 -17
- package/package.json +9 -9
- package/node_modules/glob/changelog.md +0 -67
- package/node_modules/hosted-git-info/CHANGELOG.md +0 -151
- package/node_modules/hosted-git-info/LICENSE +0 -13
- package/node_modules/hosted-git-info/README.md +0 -133
- package/node_modules/hosted-git-info/git-host-info.js +0 -79
- package/node_modules/hosted-git-info/git-host.js +0 -156
- package/node_modules/hosted-git-info/index.js +0 -148
- package/node_modules/hosted-git-info/package.json +0 -44
- package/node_modules/is-callable/.github/main.workflow +0 -14
- package/node_modules/is-core-module/.eslintignore +0 -1
- package/node_modules/json-parse-better-errors/CHANGELOG.md +0 -46
- package/node_modules/json-parse-better-errors/LICENSE.md +0 -7
- package/node_modules/json-parse-better-errors/README.md +0 -46
- package/node_modules/json-parse-better-errors/index.js +0 -38
- package/node_modules/json-parse-better-errors/package.json +0 -49
- package/node_modules/json-schema/draft-00/hyper-schema +0 -68
- package/node_modules/json-schema/draft-00/json-ref +0 -26
- package/node_modules/json-schema/draft-00/links +0 -33
- package/node_modules/json-schema/draft-00/schema +0 -155
- package/node_modules/json-schema/draft-01/hyper-schema +0 -68
- package/node_modules/json-schema/draft-01/json-ref +0 -26
- package/node_modules/json-schema/draft-01/links +0 -33
- package/node_modules/json-schema/draft-01/schema +0 -155
- package/node_modules/json-schema/draft-02/hyper-schema +0 -68
- package/node_modules/json-schema/draft-02/json-ref +0 -26
- package/node_modules/json-schema/draft-02/links +0 -35
- package/node_modules/json-schema/draft-02/schema +0 -166
- package/node_modules/json-schema/draft-03/examples/address +0 -20
- package/node_modules/json-schema/draft-03/examples/calendar +0 -53
- package/node_modules/json-schema/draft-03/examples/card +0 -105
- package/node_modules/json-schema/draft-03/examples/geo +0 -8
- package/node_modules/json-schema/draft-03/examples/interfaces +0 -23
- package/node_modules/json-schema/draft-03/hyper-schema +0 -60
- package/node_modules/json-schema/draft-03/json-ref +0 -26
- package/node_modules/json-schema/draft-03/links +0 -35
- package/node_modules/json-schema/draft-03/schema +0 -174
- package/node_modules/json-schema/draft-04/hyper-schema +0 -60
- package/node_modules/json-schema/draft-04/links +0 -41
- package/node_modules/json-schema/draft-04/schema +0 -189
- package/node_modules/json-schema/draft-zyp-json-schema-03.xml +0 -1120
- package/node_modules/json-schema/draft-zyp-json-schema-04.xml +0 -1072
- package/node_modules/json-schema/test/tests.js +0 -95
- package/node_modules/normalize-package-data/AUTHORS +0 -4
- package/node_modules/normalize-package-data/LICENSE +0 -30
- package/node_modules/normalize-package-data/README.md +0 -106
- package/node_modules/normalize-package-data/lib/extract_description.js +0 -14
- package/node_modules/normalize-package-data/lib/fixer.js +0 -418
- package/node_modules/normalize-package-data/lib/make_warning.js +0 -23
- package/node_modules/normalize-package-data/lib/normalize.js +0 -39
- package/node_modules/normalize-package-data/lib/safe_format.js +0 -9
- package/node_modules/normalize-package-data/lib/typos.json +0 -25
- package/node_modules/normalize-package-data/lib/warning_messages.json +0 -30
- package/node_modules/normalize-package-data/package.json +0 -35
- package/node_modules/npm/node_modules/json-schema/draft-00/hyper-schema +0 -68
- package/node_modules/npm/node_modules/json-schema/draft-00/json-ref +0 -26
- package/node_modules/npm/node_modules/json-schema/draft-00/links +0 -33
- package/node_modules/npm/node_modules/json-schema/draft-00/schema +0 -155
- package/node_modules/npm/node_modules/json-schema/draft-01/hyper-schema +0 -68
- package/node_modules/npm/node_modules/json-schema/draft-01/json-ref +0 -26
- package/node_modules/npm/node_modules/json-schema/draft-01/links +0 -33
- package/node_modules/npm/node_modules/json-schema/draft-01/schema +0 -155
- package/node_modules/npm/node_modules/json-schema/draft-02/hyper-schema +0 -68
- package/node_modules/npm/node_modules/json-schema/draft-02/json-ref +0 -26
- package/node_modules/npm/node_modules/json-schema/draft-02/links +0 -35
- package/node_modules/npm/node_modules/json-schema/draft-02/schema +0 -166
- package/node_modules/npm/node_modules/json-schema/draft-03/examples/address +0 -20
- package/node_modules/npm/node_modules/json-schema/draft-03/examples/calendar +0 -53
- package/node_modules/npm/node_modules/json-schema/draft-03/examples/card +0 -105
- package/node_modules/npm/node_modules/json-schema/draft-03/examples/geo +0 -8
- package/node_modules/npm/node_modules/json-schema/draft-03/examples/interfaces +0 -23
- package/node_modules/npm/node_modules/json-schema/draft-03/hyper-schema +0 -60
- package/node_modules/npm/node_modules/json-schema/draft-03/json-ref +0 -26
- package/node_modules/npm/node_modules/json-schema/draft-03/links +0 -35
- package/node_modules/npm/node_modules/json-schema/draft-03/schema +0 -174
- package/node_modules/npm/node_modules/json-schema/draft-04/hyper-schema +0 -60
- package/node_modules/npm/node_modules/json-schema/draft-04/links +0 -41
- package/node_modules/npm/node_modules/json-schema/draft-04/schema +0 -189
- package/node_modules/npm/node_modules/json-schema/draft-zyp-json-schema-03.xml +0 -1120
- package/node_modules/npm/node_modules/json-schema/draft-zyp-json-schema-04.xml +0 -1072
- package/node_modules/npm/node_modules/json-schema/test/tests.js +0 -95
- package/node_modules/npm/node_modules/path-parse/.travis.yml +0 -9
- package/node_modules/npm/node_modules/path-parse/test.js +0 -77
- package/node_modules/qs/LICENSE +0 -28
- package/node_modules/qs/test/.eslintrc +0 -17
- package/node_modules/qs/test/index.js +0 -7
- package/node_modules/request/node_modules/qs/.eslintignore +0 -1
- package/node_modules/request/node_modules/qs/LICENSE +0 -28
- package/node_modules/request/node_modules/qs/test/.eslintrc +0 -15
- package/node_modules/resolve/.eslintignore +0 -1
- package/node_modules/resolve/test/.eslintrc +0 -5
- package/node_modules/signal-exit/CHANGELOG.md +0 -35
- package/node_modules/spdx-correct/LICENSE +0 -202
- package/node_modules/spdx-correct/README.md +0 -14
- package/node_modules/spdx-correct/index.js +0 -364
- package/node_modules/spdx-correct/package.json +0 -43
- package/node_modules/spdx-exceptions/README.md +0 -36
- package/node_modules/spdx-exceptions/index.json +0 -40
- package/node_modules/spdx-exceptions/package.json +0 -21
- package/node_modules/spdx-expression-parse/AUTHORS +0 -4
- package/node_modules/spdx-expression-parse/LICENSE +0 -22
- package/node_modules/spdx-expression-parse/README.md +0 -91
- package/node_modules/spdx-expression-parse/index.js +0 -8
- package/node_modules/spdx-expression-parse/package.json +0 -43
- package/node_modules/spdx-expression-parse/parse.js +0 -138
- package/node_modules/spdx-expression-parse/scan.js +0 -131
- package/node_modules/spdx-license-ids/README.md +0 -52
- package/node_modules/spdx-license-ids/deprecated.json +0 -26
- package/node_modules/spdx-license-ids/index.json +0 -432
- package/node_modules/spdx-license-ids/package.json +0 -44
- package/node_modules/sshpk/.npmignore +0 -9
- package/node_modules/validate-npm-package-license/LICENSE +0 -202
- package/node_modules/validate-npm-package-license/README.md +0 -113
- package/node_modules/validate-npm-package-license/index.js +0 -86
- package/node_modules/validate-npm-package-license/package.json +0 -32
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet.
|
|
4
|
+
// but the path reservations are required to avoid race conditions where
|
|
5
|
+
// parallelized unpack ops may mess with one another, due to dependencies
|
|
6
|
+
// (like a Link depending on its target) or destructive operations (like
|
|
7
|
+
// clobbering an fs object to create one of a different type.)
|
|
8
|
+
|
|
3
9
|
const assert = require('assert')
|
|
4
10
|
const EE = require('events').EventEmitter
|
|
5
11
|
const Parser = require('./parse.js')
|
|
@@ -9,9 +15,15 @@ const path = require('path')
|
|
|
9
15
|
const mkdir = require('./mkdir.js')
|
|
10
16
|
const mkdirSync = mkdir.sync
|
|
11
17
|
const wc = require('./winchars.js')
|
|
18
|
+
const stripAbsolutePath = require('./strip-absolute-path.js')
|
|
19
|
+
const pathReservations = require('./path-reservations.js')
|
|
20
|
+
const normPath = require('./normalize-windows-path.js')
|
|
21
|
+
const stripSlash = require('./strip-trailing-slashes.js')
|
|
12
22
|
|
|
13
23
|
const ONENTRY = Symbol('onEntry')
|
|
14
24
|
const CHECKFS = Symbol('checkFs')
|
|
25
|
+
const CHECKFS2 = Symbol('checkFs2')
|
|
26
|
+
const PRUNECACHE = Symbol('pruneCache')
|
|
15
27
|
const ISREUSABLE = Symbol('isReusable')
|
|
16
28
|
const MAKEFS = Symbol('makeFs')
|
|
17
29
|
const FILE = Symbol('file')
|
|
@@ -33,7 +45,10 @@ const SKIP = Symbol('skip')
|
|
|
33
45
|
const DOCHOWN = Symbol('doChown')
|
|
34
46
|
const UID = Symbol('uid')
|
|
35
47
|
const GID = Symbol('gid')
|
|
48
|
+
const CHECKED_CWD = Symbol('checkedCwd')
|
|
36
49
|
const crypto = require('crypto')
|
|
50
|
+
const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform
|
|
51
|
+
const isWindows = platform === 'win32'
|
|
37
52
|
|
|
38
53
|
// Unlinks on Windows are not atomic.
|
|
39
54
|
//
|
|
@@ -52,7 +67,7 @@ const crypto = require('crypto')
|
|
|
52
67
|
// See: https://github.com/npm/node-tar/issues/183
|
|
53
68
|
/* istanbul ignore next */
|
|
54
69
|
const unlinkFile = (path, cb) => {
|
|
55
|
-
if (
|
|
70
|
+
if (!isWindows)
|
|
56
71
|
return fs.unlink(path, cb)
|
|
57
72
|
|
|
58
73
|
const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')
|
|
@@ -65,7 +80,7 @@ const unlinkFile = (path, cb) => {
|
|
|
65
80
|
|
|
66
81
|
/* istanbul ignore next */
|
|
67
82
|
const unlinkFileSync = path => {
|
|
68
|
-
if (
|
|
83
|
+
if (!isWindows)
|
|
69
84
|
return fs.unlinkSync(path)
|
|
70
85
|
|
|
71
86
|
const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')
|
|
@@ -79,6 +94,33 @@ const uint32 = (a, b, c) =>
|
|
|
79
94
|
: b === b >>> 0 ? b
|
|
80
95
|
: c
|
|
81
96
|
|
|
97
|
+
// clear the cache if it's a case-insensitive unicode-squashing match.
|
|
98
|
+
// we can't know if the current file system is case-sensitive or supports
|
|
99
|
+
// unicode fully, so we check for similarity on the maximally compatible
|
|
100
|
+
// representation. Err on the side of pruning, since all it's doing is
|
|
101
|
+
// preventing lstats, and it's not the end of the world if we get a false
|
|
102
|
+
// positive.
|
|
103
|
+
// Note that on windows, we always drop the entire cache whenever a
|
|
104
|
+
// symbolic link is encountered, because 8.3 filenames are impossible
|
|
105
|
+
// to reason about, and collisions are hazards rather than just failures.
|
|
106
|
+
const cacheKeyNormalize = path => stripSlash(normPath(path))
|
|
107
|
+
.normalize('NFKD')
|
|
108
|
+
.toLowerCase()
|
|
109
|
+
|
|
110
|
+
const pruneCache = (cache, abs) => {
|
|
111
|
+
abs = cacheKeyNormalize(abs)
|
|
112
|
+
for (const path of cache.keys()) {
|
|
113
|
+
const pnorm = cacheKeyNormalize(path)
|
|
114
|
+
if (pnorm === abs || pnorm.indexOf(abs + '/') === 0)
|
|
115
|
+
cache.delete(path)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const dropCache = cache => {
|
|
120
|
+
for (const key of cache.keys())
|
|
121
|
+
cache.delete(key)
|
|
122
|
+
}
|
|
123
|
+
|
|
82
124
|
class Unpack extends Parser {
|
|
83
125
|
constructor (opt) {
|
|
84
126
|
if (!opt)
|
|
@@ -91,6 +133,10 @@ class Unpack extends Parser {
|
|
|
91
133
|
|
|
92
134
|
super(opt)
|
|
93
135
|
|
|
136
|
+
this[CHECKED_CWD] = false
|
|
137
|
+
|
|
138
|
+
this.reservations = pathReservations()
|
|
139
|
+
|
|
94
140
|
this.transform = typeof opt.transform === 'function' ? opt.transform : null
|
|
95
141
|
|
|
96
142
|
this.writable = true
|
|
@@ -133,7 +179,7 @@ class Unpack extends Parser {
|
|
|
133
179
|
this.forceChown = opt.forceChown === true
|
|
134
180
|
|
|
135
181
|
// turn ><?| in filenames into 0xf000-higher encoded forms
|
|
136
|
-
this.win32 = !!opt.win32 ||
|
|
182
|
+
this.win32 = !!opt.win32 || isWindows
|
|
137
183
|
|
|
138
184
|
// do not unpack over files that are newer than what's in the archive
|
|
139
185
|
this.newer = !!opt.newer
|
|
@@ -153,7 +199,7 @@ class Unpack extends Parser {
|
|
|
153
199
|
// links, and removes symlink directories rather than erroring
|
|
154
200
|
this.unlink = !!opt.unlink
|
|
155
201
|
|
|
156
|
-
this.cwd = path.resolve(opt.cwd || process.cwd())
|
|
202
|
+
this.cwd = normPath(path.resolve(opt.cwd || process.cwd()))
|
|
157
203
|
this.strip = +opt.strip || 0
|
|
158
204
|
this.processUmask = process.umask()
|
|
159
205
|
this.umask = typeof opt.umask === 'number' ? opt.umask : this.processUmask
|
|
@@ -174,46 +220,72 @@ class Unpack extends Parser {
|
|
|
174
220
|
|
|
175
221
|
[CHECKPATH] (entry) {
|
|
176
222
|
if (this.strip) {
|
|
177
|
-
const parts = entry.path.split(
|
|
223
|
+
const parts = normPath(entry.path).split('/')
|
|
178
224
|
if (parts.length < this.strip)
|
|
179
225
|
return false
|
|
180
226
|
entry.path = parts.slice(this.strip).join('/')
|
|
181
227
|
|
|
182
228
|
if (entry.type === 'Link') {
|
|
183
|
-
const linkparts = entry.linkpath.split(
|
|
229
|
+
const linkparts = normPath(entry.linkpath).split('/')
|
|
184
230
|
if (linkparts.length >= this.strip)
|
|
185
231
|
entry.linkpath = linkparts.slice(this.strip).join('/')
|
|
232
|
+
else
|
|
233
|
+
return false
|
|
186
234
|
}
|
|
187
235
|
}
|
|
188
236
|
|
|
189
237
|
if (!this.preservePaths) {
|
|
190
|
-
const p = entry.path
|
|
191
|
-
|
|
192
|
-
|
|
238
|
+
const p = normPath(entry.path)
|
|
239
|
+
const parts = p.split('/')
|
|
240
|
+
if (parts.includes('..') || isWindows && /^[a-z]:\.\.$/i.test(parts[0])) {
|
|
241
|
+
this.warn(`path contains '..'`, p)
|
|
193
242
|
return false
|
|
194
243
|
}
|
|
195
244
|
|
|
196
|
-
//
|
|
197
|
-
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
this.warn(
|
|
201
|
-
entry.path = p.substr(parsed.root.length)
|
|
245
|
+
// strip off the root
|
|
246
|
+
const s = stripAbsolutePath(p)
|
|
247
|
+
if (s[0]) {
|
|
248
|
+
entry.path = s[1]
|
|
249
|
+
this.warn(`stripping ${s[0]} from absolute path`, p)
|
|
202
250
|
}
|
|
203
251
|
}
|
|
204
252
|
|
|
253
|
+
if (path.isAbsolute(entry.path))
|
|
254
|
+
entry.absolute = normPath(path.resolve(entry.path))
|
|
255
|
+
else
|
|
256
|
+
entry.absolute = normPath(path.resolve(this.cwd, entry.path))
|
|
257
|
+
|
|
258
|
+
// if we somehow ended up with a path that escapes the cwd, and we are
|
|
259
|
+
// not in preservePaths mode, then something is fishy! This should have
|
|
260
|
+
// been prevented above, so ignore this for coverage.
|
|
261
|
+
/* istanbul ignore if - defense in depth */
|
|
262
|
+
if (!this.preservePaths &&
|
|
263
|
+
entry.absolute.indexOf(this.cwd + '/') !== 0 &&
|
|
264
|
+
entry.absolute !== this.cwd) {
|
|
265
|
+
this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', {
|
|
266
|
+
entry,
|
|
267
|
+
path: normPath(entry.path),
|
|
268
|
+
resolvedPath: entry.absolute,
|
|
269
|
+
cwd: this.cwd,
|
|
270
|
+
})
|
|
271
|
+
return false
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// an archive can set properties on the extraction directory, but it
|
|
275
|
+
// may not replace the cwd with a different kind of thing entirely.
|
|
276
|
+
if (entry.absolute === this.cwd &&
|
|
277
|
+
entry.type !== 'Directory' &&
|
|
278
|
+
entry.type !== 'GNUDumpDir')
|
|
279
|
+
return false
|
|
280
|
+
|
|
205
281
|
// only encode : chars that aren't drive letter indicators
|
|
206
282
|
if (this.win32) {
|
|
207
|
-
const
|
|
208
|
-
entry.
|
|
209
|
-
|
|
283
|
+
const { root: aRoot } = path.win32.parse(entry.absolute)
|
|
284
|
+
entry.absolute = aRoot + wc.encode(entry.absolute.substr(aRoot.length))
|
|
285
|
+
const { root: pRoot } = path.win32.parse(entry.path)
|
|
286
|
+
entry.path = pRoot + wc.encode(entry.path.substr(pRoot.length))
|
|
210
287
|
}
|
|
211
288
|
|
|
212
|
-
if (path.isAbsolute(entry.path))
|
|
213
|
-
entry.absolute = entry.path
|
|
214
|
-
else
|
|
215
|
-
entry.absolute = path.resolve(this.cwd, entry.path)
|
|
216
|
-
|
|
217
289
|
return true
|
|
218
290
|
}
|
|
219
291
|
|
|
@@ -257,7 +329,7 @@ class Unpack extends Parser {
|
|
|
257
329
|
}
|
|
258
330
|
|
|
259
331
|
[MKDIR] (dir, mode, cb) {
|
|
260
|
-
mkdir(dir, {
|
|
332
|
+
mkdir(normPath(dir), {
|
|
261
333
|
uid: this.uid,
|
|
262
334
|
gid: this.gid,
|
|
263
335
|
processUid: this.processUid,
|
|
@@ -291,21 +363,44 @@ class Unpack extends Parser {
|
|
|
291
363
|
return uint32(this.gid, entry.gid, this.processGid)
|
|
292
364
|
}
|
|
293
365
|
|
|
294
|
-
[FILE] (entry) {
|
|
366
|
+
[FILE] (entry, fullyDone) {
|
|
295
367
|
const mode = entry.mode & 0o7777 || this.fmode
|
|
296
368
|
const stream = new fsm.WriteStream(entry.absolute, {
|
|
297
369
|
mode: mode,
|
|
298
370
|
autoClose: false
|
|
299
371
|
})
|
|
300
|
-
stream.on('error', er =>
|
|
372
|
+
stream.on('error', er => {
|
|
373
|
+
if (stream.fd)
|
|
374
|
+
fs.close(stream.fd, () => {})
|
|
375
|
+
|
|
376
|
+
// flush all the data out so that we aren't left hanging
|
|
377
|
+
// if the error wasn't actually fatal. otherwise the parse
|
|
378
|
+
// is blocked, and we never proceed.
|
|
379
|
+
/* istanbul ignore next */
|
|
380
|
+
stream.write = () => true
|
|
381
|
+
this[ONERROR](er, entry)
|
|
382
|
+
fullyDone()
|
|
383
|
+
})
|
|
301
384
|
|
|
302
385
|
let actions = 1
|
|
303
386
|
const done = er => {
|
|
304
|
-
if (er)
|
|
305
|
-
|
|
387
|
+
if (er) {
|
|
388
|
+
/* istanbul ignore else - we should always have a fd by now */
|
|
389
|
+
if (stream.fd)
|
|
390
|
+
fs.close(stream.fd, () => {})
|
|
306
391
|
|
|
307
|
-
|
|
308
|
-
|
|
392
|
+
this[ONERROR](er, entry)
|
|
393
|
+
fullyDone()
|
|
394
|
+
return
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
if (--actions === 0) {
|
|
398
|
+
fs.close(stream.fd, er => {
|
|
399
|
+
fullyDone()
|
|
400
|
+
/* istanbul ignore next */
|
|
401
|
+
er ? this[ONERROR](er, entry) : this[UNPEND]()
|
|
402
|
+
})
|
|
403
|
+
}
|
|
309
404
|
}
|
|
310
405
|
|
|
311
406
|
stream.on('finish', _ => {
|
|
@@ -344,15 +439,18 @@ class Unpack extends Parser {
|
|
|
344
439
|
tx.pipe(stream)
|
|
345
440
|
}
|
|
346
441
|
|
|
347
|
-
[DIRECTORY] (entry) {
|
|
442
|
+
[DIRECTORY] (entry, fullyDone) {
|
|
348
443
|
const mode = entry.mode & 0o7777 || this.dmode
|
|
349
444
|
this[MKDIR](entry.absolute, mode, er => {
|
|
350
|
-
if (er)
|
|
445
|
+
if (er) {
|
|
446
|
+
fullyDone()
|
|
351
447
|
return this[ONERROR](er, entry)
|
|
448
|
+
}
|
|
352
449
|
|
|
353
450
|
let actions = 1
|
|
354
451
|
const done = _ => {
|
|
355
452
|
if (--actions === 0) {
|
|
453
|
+
fullyDone()
|
|
356
454
|
this[UNPEND]()
|
|
357
455
|
entry.resume()
|
|
358
456
|
}
|
|
@@ -377,12 +475,13 @@ class Unpack extends Parser {
|
|
|
377
475
|
entry.resume()
|
|
378
476
|
}
|
|
379
477
|
|
|
380
|
-
[SYMLINK] (entry) {
|
|
381
|
-
this[LINK](entry, entry.linkpath, 'symlink')
|
|
478
|
+
[SYMLINK] (entry, done) {
|
|
479
|
+
this[LINK](entry, entry.linkpath, 'symlink', done)
|
|
382
480
|
}
|
|
383
481
|
|
|
384
|
-
[HARDLINK] (entry) {
|
|
385
|
-
|
|
482
|
+
[HARDLINK] (entry, done) {
|
|
483
|
+
const linkpath = normPath(path.resolve(this.cwd, entry.linkpath))
|
|
484
|
+
this[LINK](entry, linkpath, 'link', done)
|
|
386
485
|
}
|
|
387
486
|
|
|
388
487
|
[PEND] () {
|
|
@@ -407,35 +506,122 @@ class Unpack extends Parser {
|
|
|
407
506
|
!this.unlink &&
|
|
408
507
|
st.isFile() &&
|
|
409
508
|
st.nlink <= 1 &&
|
|
410
|
-
|
|
509
|
+
!isWindows
|
|
411
510
|
}
|
|
412
511
|
|
|
413
512
|
// check if a thing is there, and if so, try to clobber it
|
|
414
513
|
[CHECKFS] (entry) {
|
|
415
514
|
this[PEND]()
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
515
|
+
const paths = [entry.path]
|
|
516
|
+
if (entry.linkpath)
|
|
517
|
+
paths.push(entry.linkpath)
|
|
518
|
+
this.reservations.reserve(paths, done => this[CHECKFS2](entry, done))
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
[PRUNECACHE] (entry) {
|
|
522
|
+
// if we are not creating a directory, and the path is in the dirCache,
|
|
523
|
+
// then that means we are about to delete the directory we created
|
|
524
|
+
// previously, and it is no longer going to be a directory, and neither
|
|
525
|
+
// is any of its children.
|
|
526
|
+
// If a symbolic link is encountered, all bets are off. There is no
|
|
527
|
+
// reasonable way to sanitize the cache in such a way we will be able to
|
|
528
|
+
// avoid having filesystem collisions. If this happens with a non-symlink
|
|
529
|
+
// entry, it'll just fail to unpack, but a symlink to a directory, using an
|
|
530
|
+
// 8.3 shortname or certain unicode attacks, can evade detection and lead
|
|
531
|
+
// to arbitrary writes to anywhere on the system.
|
|
532
|
+
if (entry.type === 'SymbolicLink')
|
|
533
|
+
dropCache(this.dirCache)
|
|
534
|
+
else if (entry.type !== 'Directory')
|
|
535
|
+
pruneCache(this.dirCache, entry.absolute)
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
[CHECKFS2] (entry, fullyDone) {
|
|
539
|
+
this[PRUNECACHE](entry)
|
|
540
|
+
|
|
541
|
+
const done = er => {
|
|
542
|
+
this[PRUNECACHE](entry)
|
|
543
|
+
fullyDone(er)
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
const checkCwd = () => {
|
|
547
|
+
this[MKDIR](this.cwd, this.dmode, er => {
|
|
548
|
+
if (er) {
|
|
549
|
+
this[ONERROR](er, entry)
|
|
550
|
+
done()
|
|
551
|
+
return
|
|
552
|
+
}
|
|
553
|
+
this[CHECKED_CWD] = true
|
|
554
|
+
start()
|
|
555
|
+
})
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
const start = () => {
|
|
559
|
+
if (entry.absolute !== this.cwd) {
|
|
560
|
+
const parent = normPath(path.dirname(entry.absolute))
|
|
561
|
+
if (parent !== this.cwd) {
|
|
562
|
+
return this[MKDIR](parent, this.dmode, er => {
|
|
563
|
+
if (er) {
|
|
564
|
+
this[ONERROR](er, entry)
|
|
565
|
+
done()
|
|
566
|
+
return
|
|
567
|
+
}
|
|
568
|
+
afterMakeParent()
|
|
569
|
+
})
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
afterMakeParent()
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
const afterMakeParent = () => {
|
|
576
|
+
fs.lstat(entry.absolute, (lstatEr, st) => {
|
|
577
|
+
if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {
|
|
421
578
|
this[SKIP](entry)
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
579
|
+
done()
|
|
580
|
+
return
|
|
581
|
+
}
|
|
582
|
+
if (lstatEr || this[ISREUSABLE](entry, st))
|
|
583
|
+
return this[MAKEFS](null, entry, done)
|
|
584
|
+
|
|
585
|
+
if (st.isDirectory()) {
|
|
425
586
|
if (entry.type === 'Directory') {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
587
|
+
const needChmod = !this.noChmod &&
|
|
588
|
+
entry.mode &&
|
|
589
|
+
(st.mode & 0o7777) !== entry.mode
|
|
590
|
+
const afterChmod = er => this[MAKEFS](er, entry, done)
|
|
591
|
+
if (!needChmod)
|
|
592
|
+
return afterChmod()
|
|
593
|
+
return fs.chmod(entry.absolute, entry.mode, afterChmod)
|
|
594
|
+
}
|
|
595
|
+
// Not a dir entry, have to remove it.
|
|
596
|
+
// NB: the only way to end up with an entry that is the cwd
|
|
597
|
+
// itself, in such a way that == does not detect, is a
|
|
598
|
+
// tricky windows absolute path with UNC or 8.3 parts (and
|
|
599
|
+
// preservePaths:true, or else it will have been stripped).
|
|
600
|
+
// In that case, the user has opted out of path protections
|
|
601
|
+
// explicitly, so if they blow away the cwd, c'est la vie.
|
|
602
|
+
if (entry.absolute !== this.cwd) {
|
|
603
|
+
return fs.rmdir(entry.absolute, er =>
|
|
604
|
+
this[MAKEFS](er, entry, done))
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// not a dir, and not reusable
|
|
609
|
+
// don't remove if the cwd, we want that error
|
|
610
|
+
if (entry.absolute === this.cwd)
|
|
611
|
+
return this[MAKEFS](null, entry, done)
|
|
612
|
+
|
|
613
|
+
unlinkFile(entry.absolute, er =>
|
|
614
|
+
this[MAKEFS](er, entry, done))
|
|
434
615
|
})
|
|
435
|
-
}
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
if (this[CHECKED_CWD])
|
|
619
|
+
start()
|
|
620
|
+
else
|
|
621
|
+
checkCwd()
|
|
436
622
|
}
|
|
437
623
|
|
|
438
|
-
[MAKEFS] (er, entry) {
|
|
624
|
+
[MAKEFS] (er, entry, done) {
|
|
439
625
|
if (er)
|
|
440
626
|
return this[ONERROR](er, entry)
|
|
441
627
|
|
|
@@ -443,73 +629,107 @@ class Unpack extends Parser {
|
|
|
443
629
|
case 'File':
|
|
444
630
|
case 'OldFile':
|
|
445
631
|
case 'ContiguousFile':
|
|
446
|
-
return this[FILE](entry)
|
|
632
|
+
return this[FILE](entry, done)
|
|
447
633
|
|
|
448
634
|
case 'Link':
|
|
449
|
-
return this[HARDLINK](entry)
|
|
635
|
+
return this[HARDLINK](entry, done)
|
|
450
636
|
|
|
451
637
|
case 'SymbolicLink':
|
|
452
|
-
return this[SYMLINK](entry)
|
|
638
|
+
return this[SYMLINK](entry, done)
|
|
453
639
|
|
|
454
640
|
case 'Directory':
|
|
455
641
|
case 'GNUDumpDir':
|
|
456
|
-
return this[DIRECTORY](entry)
|
|
642
|
+
return this[DIRECTORY](entry, done)
|
|
457
643
|
}
|
|
458
644
|
}
|
|
459
645
|
|
|
460
|
-
[LINK] (entry, linkpath, link) {
|
|
461
|
-
// XXX: get the type ('
|
|
646
|
+
[LINK] (entry, linkpath, link, done) {
|
|
647
|
+
// XXX: get the type ('symlink' or 'junction') for windows
|
|
462
648
|
fs[link](linkpath, entry.absolute, er => {
|
|
463
649
|
if (er)
|
|
464
650
|
return this[ONERROR](er, entry)
|
|
651
|
+
done()
|
|
465
652
|
this[UNPEND]()
|
|
466
653
|
entry.resume()
|
|
467
654
|
})
|
|
468
655
|
}
|
|
469
656
|
}
|
|
470
657
|
|
|
658
|
+
const callSync = fn => {
|
|
659
|
+
try {
|
|
660
|
+
return [null, fn()]
|
|
661
|
+
} catch (er) {
|
|
662
|
+
return [er, null]
|
|
663
|
+
}
|
|
664
|
+
}
|
|
471
665
|
class UnpackSync extends Unpack {
|
|
472
|
-
|
|
473
|
-
super(
|
|
666
|
+
[MAKEFS] (er, entry) {
|
|
667
|
+
return super[MAKEFS](er, entry, /* istanbul ignore next */ () => {})
|
|
474
668
|
}
|
|
475
669
|
|
|
476
670
|
[CHECKFS] (entry) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
} else
|
|
495
|
-
unlinkFileSync(entry.absolute)
|
|
496
|
-
return this[MAKEFS](null, entry)
|
|
497
|
-
} catch (er) {
|
|
498
|
-
return this[ONERROR](er, entry)
|
|
499
|
-
}
|
|
671
|
+
this[PRUNECACHE](entry)
|
|
672
|
+
|
|
673
|
+
if (!this[CHECKED_CWD]) {
|
|
674
|
+
const er = this[MKDIR](this.cwd, this.dmode)
|
|
675
|
+
if (er)
|
|
676
|
+
return this[ONERROR](er, entry)
|
|
677
|
+
this[CHECKED_CWD] = true
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
// don't bother to make the parent if the current entry is the cwd,
|
|
681
|
+
// we've already checked it.
|
|
682
|
+
if (entry.absolute !== this.cwd) {
|
|
683
|
+
const parent = normPath(path.dirname(entry.absolute))
|
|
684
|
+
if (parent !== this.cwd) {
|
|
685
|
+
const mkParent = this[MKDIR](parent, this.dmode)
|
|
686
|
+
if (mkParent)
|
|
687
|
+
return this[ONERROR](mkParent, entry)
|
|
500
688
|
}
|
|
501
|
-
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
const [lstatEr, st] = callSync(() => fs.lstatSync(entry.absolute))
|
|
692
|
+
if (st && (this.keep || this.newer && st.mtime > entry.mtime))
|
|
693
|
+
return this[SKIP](entry)
|
|
694
|
+
|
|
695
|
+
if (lstatEr || this[ISREUSABLE](entry, st))
|
|
502
696
|
return this[MAKEFS](null, entry)
|
|
697
|
+
|
|
698
|
+
if (st.isDirectory()) {
|
|
699
|
+
if (entry.type === 'Directory') {
|
|
700
|
+
const needChmod = !this.noChmod &&
|
|
701
|
+
entry.mode &&
|
|
702
|
+
(st.mode & 0o7777) !== entry.mode
|
|
703
|
+
const [er] = needChmod ? callSync(() => {
|
|
704
|
+
fs.chmodSync(entry.absolute, entry.mode)
|
|
705
|
+
}) : []
|
|
706
|
+
return this[MAKEFS](er, entry)
|
|
707
|
+
}
|
|
708
|
+
// not a dir entry, have to remove it
|
|
709
|
+
const [er] = callSync(() => fs.rmdirSync(entry.absolute))
|
|
710
|
+
this[MAKEFS](er, entry)
|
|
503
711
|
}
|
|
712
|
+
|
|
713
|
+
// not a dir, and not reusable.
|
|
714
|
+
// don't remove if it's the cwd, since we want that error.
|
|
715
|
+
const [er] = entry.absolute === this.cwd ? []
|
|
716
|
+
: callSync(() => unlinkFileSync(entry.absolute))
|
|
717
|
+
this[MAKEFS](er, entry)
|
|
504
718
|
}
|
|
505
719
|
|
|
506
|
-
[FILE] (entry) {
|
|
720
|
+
[FILE] (entry, done) {
|
|
507
721
|
const mode = entry.mode & 0o7777 || this.fmode
|
|
508
722
|
|
|
509
723
|
const oner = er => {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
724
|
+
let closeError
|
|
725
|
+
try {
|
|
726
|
+
fs.closeSync(fd)
|
|
727
|
+
} catch (e) {
|
|
728
|
+
closeError = e
|
|
729
|
+
}
|
|
730
|
+
if (er || closeError)
|
|
731
|
+
this[ONERROR](er || closeError, entry)
|
|
732
|
+
done()
|
|
513
733
|
}
|
|
514
734
|
|
|
515
735
|
let stream
|
|
@@ -570,11 +790,14 @@ class UnpackSync extends Unpack {
|
|
|
570
790
|
})
|
|
571
791
|
}
|
|
572
792
|
|
|
573
|
-
[DIRECTORY] (entry) {
|
|
793
|
+
[DIRECTORY] (entry, done) {
|
|
574
794
|
const mode = entry.mode & 0o7777 || this.dmode
|
|
575
795
|
const er = this[MKDIR](entry.absolute, mode)
|
|
576
|
-
if (er)
|
|
577
|
-
|
|
796
|
+
if (er) {
|
|
797
|
+
this[ONERROR](er, entry)
|
|
798
|
+
done()
|
|
799
|
+
return
|
|
800
|
+
}
|
|
578
801
|
if (entry.mtime && !this.noMtime) {
|
|
579
802
|
try {
|
|
580
803
|
fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime)
|
|
@@ -585,12 +808,13 @@ class UnpackSync extends Unpack {
|
|
|
585
808
|
fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry))
|
|
586
809
|
} catch (er) {}
|
|
587
810
|
}
|
|
811
|
+
done()
|
|
588
812
|
entry.resume()
|
|
589
813
|
}
|
|
590
814
|
|
|
591
815
|
[MKDIR] (dir, mode) {
|
|
592
816
|
try {
|
|
593
|
-
return mkdir.sync(dir, {
|
|
817
|
+
return mkdir.sync(normPath(dir), {
|
|
594
818
|
uid: this.uid,
|
|
595
819
|
gid: this.gid,
|
|
596
820
|
processUid: this.processUid,
|
|
@@ -607,9 +831,10 @@ class UnpackSync extends Unpack {
|
|
|
607
831
|
}
|
|
608
832
|
}
|
|
609
833
|
|
|
610
|
-
[LINK] (entry, linkpath, link) {
|
|
834
|
+
[LINK] (entry, linkpath, link, done) {
|
|
611
835
|
try {
|
|
612
836
|
fs[link + 'Sync'](linkpath, entry.absolute)
|
|
837
|
+
done()
|
|
613
838
|
entry.resume()
|
|
614
839
|
} catch (er) {
|
|
615
840
|
return this[ONERROR](er, entry)
|