Socket
Socket
Sign inDemoInstall

tar

Package Overview
Dependencies
Maintainers
2
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tar - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

test/dir-normalization.js

23

lib/extract.js

@@ -14,6 +14,2 @@ // give it a tarball and a path, and it'll dump the contents

// have to dump into a directory
opts.type = "Directory"
opts.Directory = true
if (typeof opts !== "object") {

@@ -25,2 +21,3 @@ opts = { path: opts }

opts.path = opts.path || path.resolve("node-tar-extract")
// have to dump into a directory
opts.type = "Directory"

@@ -52,5 +49,16 @@ opts.Directory = true

}
if (entry.type !== "Link") return
entry.linkpath = entry.props.linkpath =
path.join(opts.path, path.join("/", entry.props.linkpath))
if (entry.type === "Link") {
entry.linkpath = entry.props.linkpath = path.join(
opts.path, path.join("/", entry.props.linkpath)
)
}
if (entry.props && entry.props.linkpath) {
var linkpath = entry.props.linkpath
// normalize paths that point outside the extraction root
if (path.resolve(opts.path, linkpath).indexOf(opts.path) !== 0) {
entry.props.linkpath = path.join(opts.path, path.join("/", linkpath))
}
}
})

@@ -77,2 +85,3 @@

// console.error("\nEEEE Extract End", me._fst.path)
me.emit("finish")
me.emit("end")

@@ -79,0 +88,0 @@ me.emit("close")

@@ -5,3 +5,3 @@ {

"description": "tar for node",
"version": "1.0.3",
"version": "2.0.0",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc