tar 5.0.7 → 5.0.11

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/lib/unpack.js CHANGED
@@ -17,10 +17,13 @@ const mkdirSync = mkdir.sync
17
17
  const wc = require('./winchars.js')
18
18
  const pathReservations = require('./path-reservations.js')
19
19
  const stripAbsolutePath = require('./strip-absolute-path.js')
20
+ const normPath = require('./normalize-windows-path.js')
21
+ const stripSlash = require('./strip-trailing-slashes.js')
20
22
 
21
23
  const ONENTRY = Symbol('onEntry')
22
24
  const CHECKFS = Symbol('checkFs')
23
25
  const CHECKFS2 = Symbol('checkFs2')
26
+ const PRUNECACHE = Symbol('pruneCache')
24
27
  const ISREUSABLE = Symbol('isReusable')
25
28
  const MAKEFS = Symbol('makeFs')
26
29
  const FILE = Symbol('file')
@@ -42,13 +45,11 @@ const SKIP = Symbol('skip')
42
45
  const DOCHOWN = Symbol('doChown')
43
46
  const UID = Symbol('uid')
44
47
  const GID = Symbol('gid')
48
+ const CHECKED_CWD = Symbol('checkedCwd')
45
49
  const crypto = require('crypto')
46
50
  const getFlag = require('./get-write-flag.js')
47
-
48
- /* istanbul ignore next */
49
- const neverCalled = () => {
50
- throw new Error('sync function called cb somehow?!?')
51
- }
51
+ const platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform
52
+ const isWindows = platform === 'win32'
52
53
 
53
54
  // Unlinks on Windows are not atomic.
54
55
  //
@@ -67,7 +68,7 @@ const neverCalled = () => {
67
68
  // See: https://github.com/npm/node-tar/issues/183
68
69
  /* istanbul ignore next */
69
70
  const unlinkFile = (path, cb) => {
70
- if (process.platform !== 'win32')
71
+ if (!isWindows)
71
72
  return fs.unlink(path, cb)
72
73
 
73
74
  const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')
@@ -80,7 +81,7 @@ const unlinkFile = (path, cb) => {
80
81
 
81
82
  /* istanbul ignore next */
82
83
  const unlinkFileSync = path => {
83
- if (process.platform !== 'win32')
84
+ if (!isWindows)
84
85
  return fs.unlinkSync(path)
85
86
 
86
87
  const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')
@@ -94,6 +95,33 @@ const uint32 = (a, b, c) =>
94
95
  : b === b >>> 0 ? b
95
96
  : c
96
97
 
98
+ // clear the cache if it's a case-insensitive unicode-squashing match.
99
+ // we can't know if the current file system is case-sensitive or supports
100
+ // unicode fully, so we check for similarity on the maximally compatible
101
+ // representation. Err on the side of pruning, since all it's doing is
102
+ // preventing lstats, and it's not the end of the world if we get a false
103
+ // positive.
104
+ // Note that on windows, we always drop the entire cache whenever a
105
+ // symbolic link is encountered, because 8.3 filenames are impossible
106
+ // to reason about, and collisions are hazards rather than just failures.
107
+ const cacheKeyNormalize = path => stripSlash(normPath(path))
108
+ .normalize('NFKD')
109
+ .toLowerCase()
110
+
111
+ const pruneCache = (cache, abs) => {
112
+ abs = cacheKeyNormalize(abs)
113
+ for (const path of cache.keys()) {
114
+ const pnorm = cacheKeyNormalize(path)
115
+ if (pnorm === abs || pnorm.indexOf(abs + '/') === 0)
116
+ cache.delete(path)
117
+ }
118
+ }
119
+
120
+ const dropCache = cache => {
121
+ for (const key of cache.keys())
122
+ cache.delete(key)
123
+ }
124
+
97
125
  class Unpack extends Parser {
98
126
  constructor (opt) {
99
127
  if (!opt)
@@ -106,6 +134,8 @@ class Unpack extends Parser {
106
134
 
107
135
  super(opt)
108
136
 
137
+ this[CHECKED_CWD] = false
138
+
109
139
  this.reservations = pathReservations()
110
140
 
111
141
  this.transform = typeof opt.transform === 'function' ? opt.transform : null
@@ -150,7 +180,7 @@ class Unpack extends Parser {
150
180
  this.forceChown = opt.forceChown === true
151
181
 
152
182
  // turn ><?| in filenames into 0xf000-higher encoded forms
153
- this.win32 = !!opt.win32 || process.platform === 'win32'
183
+ this.win32 = !!opt.win32 || isWindows
154
184
 
155
185
  // do not unpack over files that are newer than what's in the archive
156
186
  this.newer = !!opt.newer
@@ -170,7 +200,7 @@ class Unpack extends Parser {
170
200
  // links, and removes symlink directories rather than erroring
171
201
  this.unlink = !!opt.unlink
172
202
 
173
- this.cwd = path.resolve(opt.cwd || process.cwd())
203
+ this.cwd = normPath(path.resolve(opt.cwd || process.cwd()))
174
204
  this.strip = +opt.strip || 0
175
205
  this.processUmask = process.umask()
176
206
  this.umask = typeof opt.umask === 'number' ? opt.umask : this.processUmask
@@ -200,21 +230,24 @@ class Unpack extends Parser {
200
230
 
201
231
  [CHECKPATH] (entry) {
202
232
  if (this.strip) {
203
- const parts = entry.path.split(/\/|\\/)
233
+ const parts = normPath(entry.path).split('/')
204
234
  if (parts.length < this.strip)
205
235
  return false
206
236
  entry.path = parts.slice(this.strip).join('/')
207
237
 
208
238
  if (entry.type === 'Link') {
209
- const linkparts = entry.linkpath.split(/\/|\\/)
239
+ const linkparts = normPath(entry.linkpath).split('/')
210
240
  if (linkparts.length >= this.strip)
211
241
  entry.linkpath = linkparts.slice(this.strip).join('/')
242
+ else
243
+ return false
212
244
  }
213
245
  }
214
246
 
215
247
  if (!this.preservePaths) {
216
- const p = entry.path
217
- if (p.match(/(^|\/|\\)\.\.(\\|\/|$)/)) {
248
+ const p = normPath(entry.path)
249
+ const parts = p.split('/')
250
+ if (parts.includes('..') || isWindows && /^[a-z]:\.\.$/i.test(parts[0])) {
218
251
  this.warn('TAR_ENTRY_ERROR', `path contains '..'`, {
219
252
  entry,
220
253
  path: p,
@@ -222,8 +255,7 @@ class Unpack extends Parser {
222
255
  return false
223
256
  }
224
257
 
225
- // absolutes on posix are also absolutes on win32
226
- // so we only need to test this one to get both
258
+ // strip off the root
227
259
  const [root, stripped] = stripAbsolutePath(p)
228
260
  if (root) {
229
261
  entry.path = stripped
@@ -234,18 +266,42 @@ class Unpack extends Parser {
234
266
  }
235
267
  }
236
268
 
269
+ if (path.isAbsolute(entry.path))
270
+ entry.absolute = normPath(path.resolve(entry.path))
271
+ else
272
+ entry.absolute = normPath(path.resolve(this.cwd, entry.path))
273
+
274
+ // if we somehow ended up with a path that escapes the cwd, and we are
275
+ // not in preservePaths mode, then something is fishy! This should have
276
+ // been prevented above, so ignore this for coverage.
277
+ /* istanbul ignore if - defense in depth */
278
+ if (!this.preservePaths &&
279
+ entry.absolute.indexOf(this.cwd + '/') !== 0 &&
280
+ entry.absolute !== this.cwd) {
281
+ this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', {
282
+ entry,
283
+ path: normPath(entry.path),
284
+ resolvedPath: entry.absolute,
285
+ cwd: this.cwd,
286
+ })
287
+ return false
288
+ }
289
+
290
+ // an archive can set properties on the extraction directory, but it
291
+ // may not replace the cwd with a different kind of thing entirely.
292
+ if (entry.absolute === this.cwd &&
293
+ entry.type !== 'Directory' &&
294
+ entry.type !== 'GNUDumpDir')
295
+ return false
296
+
237
297
  // only encode : chars that aren't drive letter indicators
238
298
  if (this.win32) {
239
- const parsed = path.win32.parse(entry.path)
240
- entry.path = parsed.root === '' ? wc.encode(entry.path)
241
- : parsed.root + wc.encode(entry.path.substr(parsed.root.length))
299
+ const { root: aRoot } = path.win32.parse(entry.absolute)
300
+ entry.absolute = aRoot + wc.encode(entry.absolute.substr(aRoot.length))
301
+ const { root: pRoot } = path.win32.parse(entry.path)
302
+ entry.path = pRoot + wc.encode(entry.path.substr(pRoot.length))
242
303
  }
243
304
 
244
- if (path.isAbsolute(entry.path))
245
- entry.absolute = entry.path
246
- else
247
- entry.absolute = path.resolve(this.cwd, entry.path)
248
-
249
305
  return true
250
306
  }
251
307
 
@@ -289,7 +345,7 @@ class Unpack extends Parser {
289
345
  }
290
346
 
291
347
  [MKDIR] (dir, mode, cb) {
292
- mkdir(dir, {
348
+ mkdir(normPath(dir), {
293
349
  uid: this.uid,
294
350
  gid: this.gid,
295
351
  processUid: this.processUid,
@@ -330,17 +386,37 @@ class Unpack extends Parser {
330
386
  mode: mode,
331
387
  autoClose: false
332
388
  })
333
- stream.on('error', er => this[ONERROR](er, entry))
389
+ stream.on('error', er => {
390
+ if (stream.fd)
391
+ fs.close(stream.fd, () => {})
392
+
393
+ // flush all the data out so that we aren't left hanging
394
+ // if the error wasn't actually fatal. otherwise the parse
395
+ // is blocked, and we never proceed.
396
+ stream.write = () => true
397
+ this[ONERROR](er, entry)
398
+ fullyDone()
399
+ })
334
400
 
335
401
  let actions = 1
336
402
  const done = er => {
337
- if (er)
338
- return this[ONERROR](er, entry)
403
+ if (er) {
404
+ /* istanbul ignore else - we should always have a fd by now */
405
+ if (stream.fd)
406
+ fs.close(stream.fd, () => {})
407
+
408
+ this[ONERROR](er, entry)
409
+ fullyDone()
410
+ return
411
+ }
339
412
 
340
413
  if (--actions === 0) {
341
414
  fs.close(stream.fd, er => {
415
+ if (er)
416
+ this[ONERROR](er, entry)
417
+ else
418
+ this[UNPEND]()
342
419
  fullyDone()
343
- er ? this[ONERROR](er, entry) : this[UNPEND]()
344
420
  })
345
421
  }
346
422
  }
@@ -375,7 +451,10 @@ class Unpack extends Parser {
375
451
 
376
452
  const tx = this.transform ? this.transform(entry) || entry : entry
377
453
  if (tx !== entry) {
378
- tx.on('error', er => this[ONERROR](er, entry))
454
+ tx.on('error', er => {
455
+ this[ONERROR](er, entry)
456
+ fullyDone()
457
+ })
379
458
  entry.pipe(tx)
380
459
  }
381
460
  tx.pipe(stream)
@@ -385,8 +464,9 @@ class Unpack extends Parser {
385
464
  const mode = entry.mode & 0o7777 || this.dmode
386
465
  this[MKDIR](entry.absolute, mode, er => {
387
466
  if (er) {
467
+ this[ONERROR](er, entry)
388
468
  fullyDone()
389
- return this[ONERROR](er, entry)
469
+ return
390
470
  }
391
471
 
392
472
  let actions = 1
@@ -424,7 +504,8 @@ class Unpack extends Parser {
424
504
  }
425
505
 
426
506
  [HARDLINK] (entry, done) {
427
- this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link', done)
507
+ const linkpath = normPath(path.resolve(this.cwd, entry.linkpath))
508
+ this[LINK](entry, linkpath, 'link', done)
428
509
  }
429
510
 
430
511
  [PEND] () {
@@ -449,7 +530,7 @@ class Unpack extends Parser {
449
530
  !this.unlink &&
450
531
  st.isFile() &&
451
532
  st.nlink <= 1 &&
452
- process.platform !== 'win32'
533
+ !isWindows
453
534
  }
454
535
 
455
536
  // check if a thing is there, and if so, try to clobber it
@@ -460,50 +541,116 @@ class Unpack extends Parser {
460
541
  paths.push(entry.linkpath)
461
542
  this.reservations.reserve(paths, done => this[CHECKFS2](entry, done))
462
543
  }
463
- [CHECKFS2] (entry, done) {
544
+
545
+ [PRUNECACHE] (entry) {
464
546
  // if we are not creating a directory, and the path is in the dirCache,
465
547
  // then that means we are about to delete the directory we created
466
548
  // previously, and it is no longer going to be a directory, and neither
467
549
  // is any of its children.
468
- if (entry.type !== 'Directory') {
469
- for (const path of this.dirCache.keys()) {
470
- if (path === entry.absolute ||
471
- path.indexOf(entry.absolute + '/') === 0 ||
472
- path.indexOf(entry.absolute + '\\') === 0)
473
- this.dirCache.delete(path)
474
- }
550
+ // If a symbolic link is encountered, all bets are off. There is no
551
+ // reasonable way to sanitize the cache in such a way we will be able to
552
+ // avoid having filesystem collisions. If this happens with a non-symlink
553
+ // entry, it'll just fail to unpack, but a symlink to a directory, using an
554
+ // 8.3 shortname or certain unicode attacks, can evade detection and lead
555
+ // to arbitrary writes to anywhere on the system.
556
+ if (entry.type === 'SymbolicLink')
557
+ dropCache(this.dirCache)
558
+ else if (entry.type !== 'Directory')
559
+ pruneCache(this.dirCache, entry.absolute)
560
+ }
561
+
562
+ [CHECKFS2] (entry, fullyDone) {
563
+ this[PRUNECACHE](entry)
564
+
565
+ const done = er => {
566
+ this[PRUNECACHE](entry)
567
+ fullyDone(er)
475
568
  }
476
569
 
477
- this[MKDIR](path.dirname(entry.absolute), this.dmode, er => {
478
- if (er) {
479
- done()
480
- return this[ONERROR](er, entry)
570
+ const checkCwd = () => {
571
+ this[MKDIR](this.cwd, this.dmode, er => {
572
+ if (er) {
573
+ this[ONERROR](er, entry)
574
+ done()
575
+ return
576
+ }
577
+ this[CHECKED_CWD] = true
578
+ start()
579
+ })
580
+ }
581
+
582
+ const start = () => {
583
+ if (entry.absolute !== this.cwd) {
584
+ const parent = normPath(path.dirname(entry.absolute))
585
+ if (parent !== this.cwd) {
586
+ return this[MKDIR](parent, this.dmode, er => {
587
+ if (er) {
588
+ this[ONERROR](er, entry)
589
+ done()
590
+ return
591
+ }
592
+ afterMakeParent()
593
+ })
594
+ }
481
595
  }
482
- fs.lstat(entry.absolute, (er, st) => {
596
+ afterMakeParent()
597
+ }
598
+
599
+ const afterMakeParent = () => {
600
+ fs.lstat(entry.absolute, (lstatEr, st) => {
483
601
  if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {
484
602
  this[SKIP](entry)
485
603
  done()
486
- } else if (er || this[ISREUSABLE](entry, st)) {
487
- this[MAKEFS](null, entry, done)
604
+ return
488
605
  }
489
- else if (st.isDirectory()) {
606
+ if (lstatEr || this[ISREUSABLE](entry, st))
607
+ return this[MAKEFS](null, entry, done)
608
+
609
+ if (st.isDirectory()) {
490
610
  if (entry.type === 'Directory') {
491
- if (!entry.mode || (st.mode & 0o7777) === entry.mode)
492
- this[MAKEFS](null, entry, done)
493
- else
494
- fs.chmod(entry.absolute, entry.mode,
495
- er => this[MAKEFS](er, entry, done))
496
- } else
497
- fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry, done))
498
- } else
499
- unlinkFile(entry.absolute, er => this[MAKEFS](er, entry, done))
611
+ const needChmod = !this.noChmod &&
612
+ entry.mode &&
613
+ (st.mode & 0o7777) !== entry.mode
614
+ const afterChmod = er => this[MAKEFS](er, entry, done)
615
+ if (!needChmod)
616
+ return afterChmod()
617
+ return fs.chmod(entry.absolute, entry.mode, afterChmod)
618
+ }
619
+ // Not a dir entry, have to remove it.
620
+ // NB: the only way to end up with an entry that is the cwd
621
+ // itself, in such a way that == does not detect, is a
622
+ // tricky windows absolute path with UNC or 8.3 parts (and
623
+ // preservePaths:true, or else it will have been stripped).
624
+ // In that case, the user has opted out of path protections
625
+ // explicitly, so if they blow away the cwd, c'est la vie.
626
+ if (entry.absolute !== this.cwd) {
627
+ return fs.rmdir(entry.absolute, er =>
628
+ this[MAKEFS](er, entry, done))
629
+ }
630
+ }
631
+
632
+ // not a dir, and not reusable
633
+ // don't remove if the cwd, we want that error
634
+ if (entry.absolute === this.cwd)
635
+ return this[MAKEFS](null, entry, done)
636
+
637
+ unlinkFile(entry.absolute, er =>
638
+ this[MAKEFS](er, entry, done))
500
639
  })
501
- })
640
+ }
641
+
642
+ if (this[CHECKED_CWD])
643
+ start()
644
+ else
645
+ checkCwd()
502
646
  }
503
647
 
504
648
  [MAKEFS] (er, entry, done) {
505
- if (er)
506
- return this[ONERROR](er, entry)
649
+ if (er) {
650
+ this[ONERROR](er, entry)
651
+ done()
652
+ return
653
+ }
507
654
 
508
655
  switch (entry.type) {
509
656
  case 'File':
@@ -524,62 +671,82 @@ class Unpack extends Parser {
524
671
  }
525
672
 
526
673
  [LINK] (entry, linkpath, link, done) {
527
- // XXX: get the type ('file' or 'dir') for windows
674
+ // XXX: get the type ('symlink' or 'junction') for windows
528
675
  fs[link](linkpath, entry.absolute, er => {
529
676
  if (er)
530
- return this[ONERROR](er, entry)
677
+ this[ONERROR](er, entry)
678
+ else {
679
+ this[UNPEND]()
680
+ entry.resume()
681
+ }
531
682
  done()
532
- this[UNPEND]()
533
- entry.resume()
534
683
  })
535
684
  }
536
685
  }
537
686
 
687
+ const callSync = fn => {
688
+ try {
689
+ return [null, fn()]
690
+ } catch (er) {
691
+ return [er, null]
692
+ }
693
+ }
538
694
  class UnpackSync extends Unpack {
539
- constructor (opt) {
540
- super(opt)
695
+ [MAKEFS] (er, entry) {
696
+ return super[MAKEFS](er, entry, () => {})
541
697
  }
542
698
 
543
699
  [CHECKFS] (entry) {
544
- if (entry.type !== 'Directory') {
545
- for (const path of this.dirCache.keys()) {
546
- if (path === entry.absolute ||
547
- path.indexOf(entry.absolute + '/') === 0 ||
548
- path.indexOf(entry.absolute + '\\') === 0)
549
- this.dirCache.delete(path)
700
+ this[PRUNECACHE](entry)
701
+
702
+ if (!this[CHECKED_CWD]) {
703
+ const er = this[MKDIR](this.cwd, this.dmode)
704
+ if (er)
705
+ return this[ONERROR](er, entry)
706
+ this[CHECKED_CWD] = true
707
+ }
708
+
709
+ // don't bother to make the parent if the current entry is the cwd,
710
+ // we've already checked it.
711
+ if (entry.absolute !== this.cwd) {
712
+ const parent = normPath(path.dirname(entry.absolute))
713
+ if (parent !== this.cwd) {
714
+ const mkParent = this[MKDIR](parent, this.dmode)
715
+ if (mkParent)
716
+ return this[ONERROR](mkParent, entry)
550
717
  }
551
718
  }
552
719
 
553
- const er = this[MKDIR](path.dirname(entry.absolute), this.dmode, neverCalled)
554
- if (er)
555
- return this[ONERROR](er, entry)
556
- try {
557
- const st = fs.lstatSync(entry.absolute)
558
- if (this.keep || this.newer && st.mtime > entry.mtime)
559
- return this[SKIP](entry)
560
- else if (this[ISREUSABLE](entry, st))
561
- return this[MAKEFS](null, entry, neverCalled)
562
- else {
563
- try {
564
- if (st.isDirectory()) {
565
- if (entry.type === 'Directory') {
566
- if (entry.mode && (st.mode & 0o7777) !== entry.mode)
567
- fs.chmodSync(entry.absolute, entry.mode)
568
- } else
569
- fs.rmdirSync(entry.absolute)
570
- } else
571
- unlinkFileSync(entry.absolute)
572
- return this[MAKEFS](null, entry, neverCalled)
573
- } catch (er) {
574
- return this[ONERROR](er, entry)
575
- }
720
+ const [lstatEr, st] = callSync(() => fs.lstatSync(entry.absolute))
721
+ if (st && (this.keep || this.newer && st.mtime > entry.mtime))
722
+ return this[SKIP](entry)
723
+
724
+ if (lstatEr || this[ISREUSABLE](entry, st))
725
+ return this[MAKEFS](null, entry)
726
+
727
+ if (st.isDirectory()) {
728
+ if (entry.type === 'Directory') {
729
+ const needChmod = !this.noChmod &&
730
+ entry.mode &&
731
+ (st.mode & 0o7777) !== entry.mode
732
+ const [er] = needChmod ? callSync(() => {
733
+ fs.chmodSync(entry.absolute, entry.mode)
734
+ }) : []
735
+ return this[MAKEFS](er, entry)
576
736
  }
577
- } catch (er) {
578
- return this[MAKEFS](null, entry, neverCalled)
737
+ // not a dir entry, have to remove it
738
+ const [er] = callSync(() => fs.rmdirSync(entry.absolute))
739
+ this[MAKEFS](er, entry)
579
740
  }
741
+
742
+ // not a dir, and not reusable.
743
+ // don't remove if it's the cwd, since we want that error.
744
+ const [er] = entry.absolute === this.cwd ? []
745
+ : callSync(() => unlinkFileSync(entry.absolute))
746
+ this[MAKEFS](er, entry)
580
747
  }
581
748
 
582
- [FILE] (entry, _) {
749
+ [FILE] (entry, done) {
583
750
  const mode = entry.mode & 0o7777 || this.fmode
584
751
 
585
752
  const oner = er => {
@@ -591,6 +758,7 @@ class UnpackSync extends Unpack {
591
758
  }
592
759
  if (er || closeError)
593
760
  this[ONERROR](er || closeError, entry)
761
+ done()
594
762
  }
595
763
 
596
764
  let stream
@@ -651,11 +819,14 @@ class UnpackSync extends Unpack {
651
819
  })
652
820
  }
653
821
 
654
- [DIRECTORY] (entry, _) {
822
+ [DIRECTORY] (entry, done) {
655
823
  const mode = entry.mode & 0o7777 || this.dmode
656
824
  const er = this[MKDIR](entry.absolute, mode)
657
- if (er)
658
- return this[ONERROR](er, entry)
825
+ if (er) {
826
+ this[ONERROR](er, entry)
827
+ done()
828
+ return
829
+ }
659
830
  if (entry.mtime && !this.noMtime) {
660
831
  try {
661
832
  fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime)
@@ -666,12 +837,13 @@ class UnpackSync extends Unpack {
666
837
  fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry))
667
838
  } catch (er) {}
668
839
  }
840
+ done()
669
841
  entry.resume()
670
842
  }
671
843
 
672
844
  [MKDIR] (dir, mode) {
673
845
  try {
674
- return mkdir.sync(dir, {
846
+ return mkdir.sync(normPath(dir), {
675
847
  uid: this.uid,
676
848
  gid: this.gid,
677
849
  processUid: this.processUid,
@@ -688,9 +860,10 @@ class UnpackSync extends Unpack {
688
860
  }
689
861
  }
690
862
 
691
- [LINK] (entry, linkpath, link, _) {
863
+ [LINK] (entry, linkpath, link, done) {
692
864
  try {
693
865
  fs[link + 'Sync'](linkpath, entry.absolute)
866
+ done()
694
867
  entry.resume()
695
868
  } catch (er) {
696
869
  return this[ONERROR](er, entry)