tar 2.2.1 → 2.2.2

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.
Files changed (59) hide show
  1. package/.nyc_output/0471d9cf-687f-4ae8-84a5-ce7468becd03.json +1 -0
  2. package/.nyc_output/12bca2bc-6a2b-4f45-abc7-8483922a524d.json +1 -0
  3. package/.nyc_output/37d58de4-deea-4808-bb77-d27685bd1501.json +1 -0
  4. package/.nyc_output/5ad8066b-6b8c-4bc8-b807-c40bf80898b7.json +1 -0
  5. package/.nyc_output/5cbf674c-7089-4b7d-b9de-2119be4dbb0b.json +1 -0
  6. package/.nyc_output/7853e29b-78ef-4ab4-b8fb-e1e176c0787b.json +1 -0
  7. package/.nyc_output/9d414044-b18d-4f6d-b2e0-531a89bf6f4f.json +1 -0
  8. package/.nyc_output/c3ffeb8c-8e79-4a2c-b678-e5a917fe721e.json +1 -0
  9. package/.nyc_output/ea0194cb-f599-402f-8876-84fb8251e8db.json +1 -0
  10. package/.nyc_output/eda6b7a3-5e15-440f-8619-e11a15a07f77.json +1 -0
  11. package/.nyc_output/fb518800-240c-42ff-811f-79e92708d9db.json +1 -0
  12. package/.nyc_output/fdecfc06-a944-4897-9530-e08f62883fc1.json +1 -0
  13. package/.nyc_output/processinfo/0471d9cf-687f-4ae8-84a5-ce7468becd03.json +1 -0
  14. package/.nyc_output/processinfo/12bca2bc-6a2b-4f45-abc7-8483922a524d.json +1 -0
  15. package/.nyc_output/processinfo/37d58de4-deea-4808-bb77-d27685bd1501.json +1 -0
  16. package/.nyc_output/processinfo/5ad8066b-6b8c-4bc8-b807-c40bf80898b7.json +1 -0
  17. package/.nyc_output/processinfo/5cbf674c-7089-4b7d-b9de-2119be4dbb0b.json +1 -0
  18. package/.nyc_output/processinfo/7853e29b-78ef-4ab4-b8fb-e1e176c0787b.json +1 -0
  19. package/.nyc_output/processinfo/9d414044-b18d-4f6d-b2e0-531a89bf6f4f.json +1 -0
  20. package/.nyc_output/processinfo/c3ffeb8c-8e79-4a2c-b678-e5a917fe721e.json +1 -0
  21. package/.nyc_output/processinfo/ea0194cb-f599-402f-8876-84fb8251e8db.json +1 -0
  22. package/.nyc_output/processinfo/eda6b7a3-5e15-440f-8619-e11a15a07f77.json +1 -0
  23. package/.nyc_output/processinfo/fb518800-240c-42ff-811f-79e92708d9db.json +1 -0
  24. package/.nyc_output/processinfo/fdecfc06-a944-4897-9530-e08f62883fc1.json +1 -0
  25. package/.nyc_output/processinfo/index.json +1 -0
  26. package/coverage/lcov-report/base.css +212 -0
  27. package/coverage/lcov-report/index.html +106 -0
  28. package/coverage/lcov-report/prettify.css +1 -0
  29. package/coverage/lcov-report/prettify.js +1 -0
  30. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  31. package/coverage/lcov-report/sorter.js +158 -0
  32. package/coverage/lcov-report/tar/index.html +93 -0
  33. package/coverage/lcov-report/tar/index.js.html +119 -0
  34. package/coverage/lcov-report/tar/lib/create.js.html +380 -0
  35. package/coverage/lcov-report/tar/lib/extract.js.html +401 -0
  36. package/coverage/lcov-report/tar/lib/header.js.html +881 -0
  37. package/coverage/lcov-report/tar/lib/high-level-opt.js.html +152 -0
  38. package/coverage/lcov-report/tar/lib/index.html +314 -0
  39. package/coverage/lcov-report/tar/lib/large-numbers.js.html +341 -0
  40. package/coverage/lcov-report/tar/lib/list.js.html +449 -0
  41. package/coverage/lcov-report/tar/lib/mkdir.js.html +686 -0
  42. package/coverage/lcov-report/tar/lib/pack.js.html +1268 -0
  43. package/coverage/lcov-report/tar/lib/parse.js.html +1310 -0
  44. package/coverage/lcov-report/tar/lib/pax.js.html +500 -0
  45. package/coverage/lcov-report/tar/lib/read-entry.js.html +347 -0
  46. package/coverage/lcov-report/tar/lib/replace.js.html +722 -0
  47. package/coverage/lcov-report/tar/lib/types.js.html +197 -0
  48. package/coverage/lcov-report/tar/lib/unpack.js.html +1604 -0
  49. package/coverage/lcov-report/tar/lib/update.js.html +173 -0
  50. package/coverage/lcov-report/tar/lib/warn-mixin.js.html +107 -0
  51. package/coverage/lcov-report/tar/lib/winchars.js.html +134 -0
  52. package/coverage/lcov-report/tar/lib/write-entry.js.html +1268 -0
  53. package/coverage/lcov.info +3690 -0
  54. package/lib/parse.js +6 -0
  55. package/package.json +2 -2
  56. package/test/link-file-entry-collision/bad-link.hex +25 -0
  57. package/test/link-file-entry-collision/bad-link.tar +0 -0
  58. package/test/link-file-entry-collision.js +39 -0
  59. package/.npmignore +0 -5
package/lib/parse.js CHANGED
@@ -38,6 +38,7 @@ function Parse () {
38
38
  me._stream = new BlockStream(512)
39
39
  me.position = 0
40
40
  me._ended = false
41
+ me._hardLinks = {}
41
42
 
42
43
  me._stream.on("error", function (e) {
43
44
  me.emit("error", e)
@@ -251,6 +252,11 @@ Parse.prototype._startEntry = function (c) {
251
252
  if (onend) entry.on("end", onend)
252
253
 
253
254
  this._entry = entry
255
+
256
+ if (entry.type === "Link") {
257
+ this._hardLinks[entry.path] = entry
258
+ }
259
+
254
260
  var me = this
255
261
 
256
262
  entry.on("pause", function () {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
3
3
  "name": "tar",
4
4
  "description": "tar for node",
5
- "version": "2.2.1",
5
+ "version": "2.2.2",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git://github.com/isaacs/node-tar.git"
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "block-stream": "*",
16
- "fstream": "^1.0.2",
16
+ "fstream": "^1.0.12",
17
17
  "inherits": "2"
18
18
  },
19
19
  "devDependencies": {
@@ -0,0 +1,25 @@
1
+ -- header for the link target --
2
+ 6261642d6c696e6b2d74617267657400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000303030363434200030303037363520003030303032342000303030303030303030333420313334363636353530353620303134333731002030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # bad-link-target.....................................................................................000644..000765..000024..00000000034.13466655056.014371..0...................................................................................................
3
+ 00757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # .ustar.00isaacs..........................staff...........................000000..000000.........................................................................................................................................................................
4
+
5
+ -- link target file contents (should not be overwritten) --
6
+ 746869732073686f756c642072656d61696e207468652073616d650a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # this.should.remain.the.same.....................................................................................................................................................................................................................................
7
+ 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # ................................................................................................................................................................................................................................................................
8
+
9
+ -- header for the link named a.txt --
10
+ 612e74787400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003030303634342000303030373635200030303030323420003030303030303030303030203133343636363535303536203031353334320020316261642d6c696e6b2d746172676574000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # a.txt...............................................................................................000644..000765..000024..00000000000.13466655056.015342..1bad-link-target....................................................................................
11
+ 00757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # .ustar.00isaacs..........................staff...........................000000..000000.........................................................................................................................................................................
12
+
13
+ -- header for file entry which attempts to overwrite the link --
14
+ 612e7478740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000303030363434200030353737363120003030303032342000303030303030303034303120313136353133363033333320303132343531002030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # a.txt...............................................................................................000644..057761..000024..00000000401.11651360333.012451..0...................................................................................................
15
+ 00757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # .ustar.00isaacs..........................staff...........................000000..000000.........................................................................................................................................................................
16
+
17
+ -- contents that threaten to overwrite the link target --
18
+ 61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 # aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
19
+ 61000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # a...............................................................................................................................................................................................................................................................
20
+
21
+ -- tar eof --
22
+ 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # ................................................................................................................................................................................................................................................................
23
+ 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # ................................................................................................................................................................................................................................................................
24
+ 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # ................................................................................................................................................................................................................................................................
25
+ 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 # ................................................................................................................................................................................................................................................................
@@ -0,0 +1,39 @@
1
+ // Set the umask, so that it works the same everywhere.
2
+ process.umask(parseInt('22', 8))
3
+
4
+ var tap = require("tap")
5
+ , tar = require("../tar.js")
6
+ , fs = require("fs")
7
+ , path = require("path")
8
+ , file = path.resolve(__dirname, "link-file-entry-collision/bad-link.tar")
9
+ , target = path.resolve(__dirname, "tmp/link-file-entry-collision")
10
+ , index = 0
11
+ , fstream = require("fstream")
12
+ , mkdirp = require("mkdirp")
13
+ , rimraf = require("rimraf")
14
+
15
+ tap.test("preclean", function (t) {
16
+ rimraf.sync(target)
17
+ t.pass("cleaned!")
18
+ t.end()
19
+ })
20
+
21
+ tap.test("extract test", function (t) {
22
+ var extract = tar.Extract(target)
23
+ var inp = fs.createReadStream(file)
24
+ inp.pipe(extract)
25
+
26
+ extract.on("end", function () {
27
+ t.equal(fs.readFileSync(target + "/bad-link-target", "utf8"),
28
+ "this should remain the same\n")
29
+ t.equal(fs.readFileSync(target + "/a.txt", "utf8"),
30
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
31
+ t.end()
32
+ })
33
+ })
34
+
35
+ tap.test("cleanup", function (t) {
36
+ rimraf.sync(target)
37
+ t.pass("cleaned!")
38
+ t.end()
39
+ })
package/.npmignore DELETED
@@ -1,5 +0,0 @@
1
- .*.swp
2
- node_modules
3
- examples/extract/
4
- test/tmp/
5
- test/fixtures/