tar 4.4.13 → 4.4.17
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/extract.js +4 -3
- package/lib/list.js +4 -3
- package/lib/mkdir.js +55 -48
- package/lib/normalize-windows-path.js +8 -0
- package/lib/pack.js +8 -18
- package/lib/path-reservations.js +128 -0
- package/lib/read-entry.js +4 -3
- package/lib/replace.js +2 -1
- package/lib/strip-absolute-path.js +14 -0
- package/lib/strip-trailing-slashes.js +24 -0
- package/lib/unpack.js +240 -85
- package/lib/write-entry.js +178 -82
- package/package.json +18 -12
package/lib/unpack.js
CHANGED
|
@@ -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,13 @@ 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')
|
|
12
21
|
|
|
13
22
|
const ONENTRY = Symbol('onEntry')
|
|
14
23
|
const CHECKFS = Symbol('checkFs')
|
|
24
|
+
const CHECKFS2 = Symbol('checkFs2')
|
|
15
25
|
const ISREUSABLE = Symbol('isReusable')
|
|
16
26
|
const MAKEFS = Symbol('makeFs')
|
|
17
27
|
const FILE = Symbol('file')
|
|
@@ -33,6 +43,7 @@ const SKIP = Symbol('skip')
|
|
|
33
43
|
const DOCHOWN = Symbol('doChown')
|
|
34
44
|
const UID = Symbol('uid')
|
|
35
45
|
const GID = Symbol('gid')
|
|
46
|
+
const CHECKED_CWD = Symbol('checkedCwd')
|
|
36
47
|
const crypto = require('crypto')
|
|
37
48
|
|
|
38
49
|
// Unlinks on Windows are not atomic.
|
|
@@ -79,6 +90,17 @@ const uint32 = (a, b, c) =>
|
|
|
79
90
|
: b === b >>> 0 ? b
|
|
80
91
|
: c
|
|
81
92
|
|
|
93
|
+
const pruneCache = (cache, abs) => {
|
|
94
|
+
// clear the cache if it's a case-insensitive match, since we can't
|
|
95
|
+
// know if the current file system is case-sensitive or not.
|
|
96
|
+
abs = normPath(abs).toLowerCase()
|
|
97
|
+
for (const path of cache.keys()) {
|
|
98
|
+
const plower = path.toLowerCase()
|
|
99
|
+
if (plower === abs || plower.toLowerCase().indexOf(abs + '/') === 0)
|
|
100
|
+
cache.delete(path)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
82
104
|
class Unpack extends Parser {
|
|
83
105
|
constructor (opt) {
|
|
84
106
|
if (!opt)
|
|
@@ -91,6 +113,10 @@ class Unpack extends Parser {
|
|
|
91
113
|
|
|
92
114
|
super(opt)
|
|
93
115
|
|
|
116
|
+
this[CHECKED_CWD] = false
|
|
117
|
+
|
|
118
|
+
this.reservations = pathReservations()
|
|
119
|
+
|
|
94
120
|
this.transform = typeof opt.transform === 'function' ? opt.transform : null
|
|
95
121
|
|
|
96
122
|
this.writable = true
|
|
@@ -153,7 +179,7 @@ class Unpack extends Parser {
|
|
|
153
179
|
// links, and removes symlink directories rather than erroring
|
|
154
180
|
this.unlink = !!opt.unlink
|
|
155
181
|
|
|
156
|
-
this.cwd = path.resolve(opt.cwd || process.cwd())
|
|
182
|
+
this.cwd = normPath(path.resolve(opt.cwd || process.cwd()))
|
|
157
183
|
this.strip = +opt.strip || 0
|
|
158
184
|
this.processUmask = process.umask()
|
|
159
185
|
this.umask = typeof opt.umask === 'number' ? opt.umask : this.processUmask
|
|
@@ -174,46 +200,56 @@ class Unpack extends Parser {
|
|
|
174
200
|
|
|
175
201
|
[CHECKPATH] (entry) {
|
|
176
202
|
if (this.strip) {
|
|
177
|
-
const parts = entry.path.split(
|
|
203
|
+
const parts = normPath(entry.path).split('/')
|
|
178
204
|
if (parts.length < this.strip)
|
|
179
205
|
return false
|
|
180
206
|
entry.path = parts.slice(this.strip).join('/')
|
|
181
207
|
|
|
182
208
|
if (entry.type === 'Link') {
|
|
183
|
-
const linkparts = entry.linkpath.split(
|
|
209
|
+
const linkparts = normPath(entry.linkpath).split('/')
|
|
184
210
|
if (linkparts.length >= this.strip)
|
|
185
211
|
entry.linkpath = linkparts.slice(this.strip).join('/')
|
|
212
|
+
else
|
|
213
|
+
return false
|
|
186
214
|
}
|
|
187
215
|
}
|
|
188
216
|
|
|
189
217
|
if (!this.preservePaths) {
|
|
190
|
-
const p = entry.path
|
|
191
|
-
if (p.
|
|
192
|
-
this.warn(
|
|
218
|
+
const p = normPath(entry.path)
|
|
219
|
+
if (p.split('/').includes('..')) {
|
|
220
|
+
this.warn(`path contains '..'`, p)
|
|
193
221
|
return false
|
|
194
222
|
}
|
|
195
223
|
|
|
196
224
|
// absolutes on posix are also absolutes on win32
|
|
197
225
|
// so we only need to test this one to get both
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
226
|
+
const s = stripAbsolutePath(p)
|
|
227
|
+
if (s[0]) {
|
|
228
|
+
entry.path = s[1]
|
|
229
|
+
this.warn(`stripping ${s[0]} from absolute path`, p)
|
|
202
230
|
}
|
|
203
231
|
}
|
|
204
232
|
|
|
233
|
+
if (path.isAbsolute(entry.path))
|
|
234
|
+
entry.absolute = normPath(path.resolve(entry.path))
|
|
235
|
+
else
|
|
236
|
+
entry.absolute = normPath(path.resolve(this.cwd, entry.path))
|
|
237
|
+
|
|
238
|
+
// an archive can set properties on the extraction directory, but it
|
|
239
|
+
// may not replace the cwd with a different kind of thing entirely.
|
|
240
|
+
if (entry.absolute === this.cwd &&
|
|
241
|
+
entry.type !== 'Directory' &&
|
|
242
|
+
entry.type !== 'GNUDumpDir')
|
|
243
|
+
return false
|
|
244
|
+
|
|
205
245
|
// only encode : chars that aren't drive letter indicators
|
|
206
246
|
if (this.win32) {
|
|
207
|
-
const
|
|
208
|
-
entry.
|
|
209
|
-
|
|
247
|
+
const { root: aRoot } = path.win32.parse(entry.absolute)
|
|
248
|
+
entry.absolute = aRoot + wc.encode(entry.absolute.substr(aRoot.length))
|
|
249
|
+
const { root: pRoot } = path.win32.parse(entry.path)
|
|
250
|
+
entry.path = pRoot + wc.encode(entry.path.substr(pRoot.length))
|
|
210
251
|
}
|
|
211
252
|
|
|
212
|
-
if (path.isAbsolute(entry.path))
|
|
213
|
-
entry.absolute = entry.path
|
|
214
|
-
else
|
|
215
|
-
entry.absolute = path.resolve(this.cwd, entry.path)
|
|
216
|
-
|
|
217
253
|
return true
|
|
218
254
|
}
|
|
219
255
|
|
|
@@ -257,7 +293,7 @@ class Unpack extends Parser {
|
|
|
257
293
|
}
|
|
258
294
|
|
|
259
295
|
[MKDIR] (dir, mode, cb) {
|
|
260
|
-
mkdir(dir, {
|
|
296
|
+
mkdir(normPath(dir), {
|
|
261
297
|
uid: this.uid,
|
|
262
298
|
gid: this.gid,
|
|
263
299
|
processUid: this.processUid,
|
|
@@ -291,21 +327,44 @@ class Unpack extends Parser {
|
|
|
291
327
|
return uint32(this.gid, entry.gid, this.processGid)
|
|
292
328
|
}
|
|
293
329
|
|
|
294
|
-
[FILE] (entry) {
|
|
330
|
+
[FILE] (entry, fullyDone) {
|
|
295
331
|
const mode = entry.mode & 0o7777 || this.fmode
|
|
296
332
|
const stream = new fsm.WriteStream(entry.absolute, {
|
|
297
333
|
mode: mode,
|
|
298
334
|
autoClose: false
|
|
299
335
|
})
|
|
300
|
-
stream.on('error', er =>
|
|
336
|
+
stream.on('error', er => {
|
|
337
|
+
if (stream.fd)
|
|
338
|
+
fs.close(stream.fd, () => {})
|
|
339
|
+
|
|
340
|
+
// flush all the data out so that we aren't left hanging
|
|
341
|
+
// if the error wasn't actually fatal. otherwise the parse
|
|
342
|
+
// is blocked, and we never proceed.
|
|
343
|
+
/* istanbul ignore next */
|
|
344
|
+
stream.write = () => true
|
|
345
|
+
this[ONERROR](er, entry)
|
|
346
|
+
fullyDone()
|
|
347
|
+
})
|
|
301
348
|
|
|
302
349
|
let actions = 1
|
|
303
350
|
const done = er => {
|
|
304
|
-
if (er)
|
|
305
|
-
|
|
351
|
+
if (er) {
|
|
352
|
+
/* istanbul ignore else - we should always have a fd by now */
|
|
353
|
+
if (stream.fd)
|
|
354
|
+
fs.close(stream.fd, () => {})
|
|
355
|
+
|
|
356
|
+
this[ONERROR](er, entry)
|
|
357
|
+
fullyDone()
|
|
358
|
+
return
|
|
359
|
+
}
|
|
306
360
|
|
|
307
|
-
if (--actions === 0)
|
|
308
|
-
fs.close(stream.fd,
|
|
361
|
+
if (--actions === 0) {
|
|
362
|
+
fs.close(stream.fd, er => {
|
|
363
|
+
fullyDone()
|
|
364
|
+
/* istanbul ignore next */
|
|
365
|
+
er ? this[ONERROR](er, entry) : this[UNPEND]()
|
|
366
|
+
})
|
|
367
|
+
}
|
|
309
368
|
}
|
|
310
369
|
|
|
311
370
|
stream.on('finish', _ => {
|
|
@@ -344,15 +403,18 @@ class Unpack extends Parser {
|
|
|
344
403
|
tx.pipe(stream)
|
|
345
404
|
}
|
|
346
405
|
|
|
347
|
-
[DIRECTORY] (entry) {
|
|
406
|
+
[DIRECTORY] (entry, fullyDone) {
|
|
348
407
|
const mode = entry.mode & 0o7777 || this.dmode
|
|
349
408
|
this[MKDIR](entry.absolute, mode, er => {
|
|
350
|
-
if (er)
|
|
409
|
+
if (er) {
|
|
410
|
+
fullyDone()
|
|
351
411
|
return this[ONERROR](er, entry)
|
|
412
|
+
}
|
|
352
413
|
|
|
353
414
|
let actions = 1
|
|
354
415
|
const done = _ => {
|
|
355
416
|
if (--actions === 0) {
|
|
417
|
+
fullyDone()
|
|
356
418
|
this[UNPEND]()
|
|
357
419
|
entry.resume()
|
|
358
420
|
}
|
|
@@ -377,12 +439,13 @@ class Unpack extends Parser {
|
|
|
377
439
|
entry.resume()
|
|
378
440
|
}
|
|
379
441
|
|
|
380
|
-
[SYMLINK] (entry) {
|
|
381
|
-
this[LINK](entry, entry.linkpath, 'symlink')
|
|
442
|
+
[SYMLINK] (entry, done) {
|
|
443
|
+
this[LINK](entry, entry.linkpath, 'symlink', done)
|
|
382
444
|
}
|
|
383
445
|
|
|
384
|
-
[HARDLINK] (entry) {
|
|
385
|
-
|
|
446
|
+
[HARDLINK] (entry, done) {
|
|
447
|
+
const linkpath = normPath(path.resolve(this.cwd, entry.linkpath))
|
|
448
|
+
this[LINK](entry, linkpath, 'link', done)
|
|
386
449
|
}
|
|
387
450
|
|
|
388
451
|
[PEND] () {
|
|
@@ -413,29 +476,92 @@ class Unpack extends Parser {
|
|
|
413
476
|
// check if a thing is there, and if so, try to clobber it
|
|
414
477
|
[CHECKFS] (entry) {
|
|
415
478
|
this[PEND]()
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
479
|
+
const paths = [entry.path]
|
|
480
|
+
if (entry.linkpath)
|
|
481
|
+
paths.push(entry.linkpath)
|
|
482
|
+
this.reservations.reserve(paths, done => this[CHECKFS2](entry, done))
|
|
483
|
+
}
|
|
484
|
+
[CHECKFS2] (entry, done) {
|
|
485
|
+
// if we are not creating a directory, and the path is in the dirCache,
|
|
486
|
+
// then that means we are about to delete the directory we created
|
|
487
|
+
// previously, and it is no longer going to be a directory, and neither
|
|
488
|
+
// is any of its children.
|
|
489
|
+
if (entry.type !== 'Directory')
|
|
490
|
+
pruneCache(this.dirCache, entry.absolute)
|
|
491
|
+
|
|
492
|
+
const checkCwd = () => {
|
|
493
|
+
this[MKDIR](this.cwd, this.dmode, er => {
|
|
494
|
+
if (er) {
|
|
495
|
+
this[ONERROR](er, entry)
|
|
496
|
+
done()
|
|
497
|
+
return
|
|
498
|
+
}
|
|
499
|
+
this[CHECKED_CWD] = true
|
|
500
|
+
start()
|
|
501
|
+
})
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
const start = () => {
|
|
505
|
+
if (entry.absolute !== this.cwd) {
|
|
506
|
+
const parent = normPath(path.dirname(entry.absolute))
|
|
507
|
+
if (parent !== this.cwd) {
|
|
508
|
+
return this[MKDIR](parent, this.dmode, er => {
|
|
509
|
+
if (er) {
|
|
510
|
+
this[ONERROR](er, entry)
|
|
511
|
+
done()
|
|
512
|
+
return
|
|
513
|
+
}
|
|
514
|
+
afterMakeParent()
|
|
515
|
+
})
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
afterMakeParent()
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
const afterMakeParent = () => {
|
|
522
|
+
fs.lstat(entry.absolute, (lstatEr, st) => {
|
|
523
|
+
if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {
|
|
421
524
|
this[SKIP](entry)
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
525
|
+
done()
|
|
526
|
+
return
|
|
527
|
+
}
|
|
528
|
+
if (lstatEr || this[ISREUSABLE](entry, st))
|
|
529
|
+
return this[MAKEFS](null, entry, done)
|
|
530
|
+
|
|
531
|
+
if (st.isDirectory()) {
|
|
425
532
|
if (entry.type === 'Directory') {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
533
|
+
const needChmod = !this.noChmod &&
|
|
534
|
+
entry.mode &&
|
|
535
|
+
(st.mode & 0o7777) !== entry.mode
|
|
536
|
+
const afterChmod = er => this[MAKEFS](er, entry, done)
|
|
537
|
+
if (!needChmod)
|
|
538
|
+
return afterChmod()
|
|
539
|
+
return fs.chmod(entry.absolute, entry.mode, afterChmod)
|
|
540
|
+
}
|
|
541
|
+
// not a dir entry, have to remove it.
|
|
542
|
+
if (entry.absolute !== this.cwd) {
|
|
543
|
+
return fs.rmdir(entry.absolute, er =>
|
|
544
|
+
this[MAKEFS](er, entry, done))
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// not a dir, and not reusable
|
|
549
|
+
// don't remove if the cwd, we want that error
|
|
550
|
+
if (entry.absolute === this.cwd)
|
|
551
|
+
return this[MAKEFS](null, entry, done)
|
|
552
|
+
|
|
553
|
+
unlinkFile(entry.absolute, er =>
|
|
554
|
+
this[MAKEFS](er, entry, done))
|
|
434
555
|
})
|
|
435
|
-
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
if (this[CHECKED_CWD])
|
|
559
|
+
start()
|
|
560
|
+
else
|
|
561
|
+
checkCwd()
|
|
436
562
|
}
|
|
437
563
|
|
|
438
|
-
[MAKEFS] (er, entry) {
|
|
564
|
+
[MAKEFS] (er, entry, done) {
|
|
439
565
|
if (er)
|
|
440
566
|
return this[ONERROR](er, entry)
|
|
441
567
|
|
|
@@ -443,67 +569,96 @@ class Unpack extends Parser {
|
|
|
443
569
|
case 'File':
|
|
444
570
|
case 'OldFile':
|
|
445
571
|
case 'ContiguousFile':
|
|
446
|
-
return this[FILE](entry)
|
|
572
|
+
return this[FILE](entry, done)
|
|
447
573
|
|
|
448
574
|
case 'Link':
|
|
449
|
-
return this[HARDLINK](entry)
|
|
575
|
+
return this[HARDLINK](entry, done)
|
|
450
576
|
|
|
451
577
|
case 'SymbolicLink':
|
|
452
|
-
return this[SYMLINK](entry)
|
|
578
|
+
return this[SYMLINK](entry, done)
|
|
453
579
|
|
|
454
580
|
case 'Directory':
|
|
455
581
|
case 'GNUDumpDir':
|
|
456
|
-
return this[DIRECTORY](entry)
|
|
582
|
+
return this[DIRECTORY](entry, done)
|
|
457
583
|
}
|
|
458
584
|
}
|
|
459
585
|
|
|
460
|
-
[LINK] (entry, linkpath, link) {
|
|
461
|
-
// XXX: get the type ('
|
|
586
|
+
[LINK] (entry, linkpath, link, done) {
|
|
587
|
+
// XXX: get the type ('symlink' or 'junction') for windows
|
|
462
588
|
fs[link](linkpath, entry.absolute, er => {
|
|
463
589
|
if (er)
|
|
464
590
|
return this[ONERROR](er, entry)
|
|
591
|
+
done()
|
|
465
592
|
this[UNPEND]()
|
|
466
593
|
entry.resume()
|
|
467
594
|
})
|
|
468
595
|
}
|
|
469
596
|
}
|
|
470
597
|
|
|
598
|
+
const callSync = fn => {
|
|
599
|
+
try {
|
|
600
|
+
return [null, fn()]
|
|
601
|
+
} catch (er) {
|
|
602
|
+
return [er, null]
|
|
603
|
+
}
|
|
604
|
+
}
|
|
471
605
|
class UnpackSync extends Unpack {
|
|
472
|
-
|
|
473
|
-
super(
|
|
606
|
+
[MAKEFS] (er, entry) {
|
|
607
|
+
return super[MAKEFS](er, entry, /* istanbul ignore next */ () => {})
|
|
474
608
|
}
|
|
475
609
|
|
|
476
610
|
[CHECKFS] (entry) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
if (
|
|
483
|
-
return this[
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
unlinkFileSync(entry.absolute)
|
|
496
|
-
return this[MAKEFS](null, entry)
|
|
497
|
-
} catch (er) {
|
|
498
|
-
return this[ONERROR](er, entry)
|
|
499
|
-
}
|
|
611
|
+
if (entry.type !== 'Directory')
|
|
612
|
+
pruneCache(this.dirCache, entry.absolute)
|
|
613
|
+
|
|
614
|
+
if (!this[CHECKED_CWD]) {
|
|
615
|
+
const er = this[MKDIR](this.cwd, this.dmode)
|
|
616
|
+
if (er)
|
|
617
|
+
return this[ONERROR](er, entry)
|
|
618
|
+
this[CHECKED_CWD] = true
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// don't bother to make the parent if the current entry is the cwd,
|
|
622
|
+
// we've already checked it.
|
|
623
|
+
if (entry.absolute !== this.cwd) {
|
|
624
|
+
const parent = normPath(path.dirname(entry.absolute))
|
|
625
|
+
if (parent !== this.cwd) {
|
|
626
|
+
const mkParent = this[MKDIR](parent, this.dmode)
|
|
627
|
+
if (mkParent)
|
|
628
|
+
return this[ONERROR](mkParent, entry)
|
|
500
629
|
}
|
|
501
|
-
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
const [lstatEr, st] = callSync(() => fs.lstatSync(entry.absolute))
|
|
633
|
+
if (st && (this.keep || this.newer && st.mtime > entry.mtime))
|
|
634
|
+
return this[SKIP](entry)
|
|
635
|
+
|
|
636
|
+
if (lstatEr || this[ISREUSABLE](entry, st))
|
|
502
637
|
return this[MAKEFS](null, entry)
|
|
638
|
+
|
|
639
|
+
if (st.isDirectory()) {
|
|
640
|
+
if (entry.type === 'Directory') {
|
|
641
|
+
const needChmod = !this.noChmod &&
|
|
642
|
+
entry.mode &&
|
|
643
|
+
(st.mode & 0o7777) !== entry.mode
|
|
644
|
+
const [er] = needChmod ? callSync(() => {
|
|
645
|
+
fs.chmodSync(entry.absolute, entry.mode)
|
|
646
|
+
}) : []
|
|
647
|
+
return this[MAKEFS](er, entry)
|
|
648
|
+
}
|
|
649
|
+
// not a dir entry, have to remove it
|
|
650
|
+
const [er] = callSync(() => fs.rmdirSync(entry.absolute))
|
|
651
|
+
this[MAKEFS](er, entry)
|
|
503
652
|
}
|
|
653
|
+
|
|
654
|
+
// not a dir, and not reusable.
|
|
655
|
+
// don't remove if it's the cwd, since we want that error.
|
|
656
|
+
const [er] = entry.absolute === this.cwd ? []
|
|
657
|
+
: callSync(() => unlinkFileSync(entry.absolute))
|
|
658
|
+
this[MAKEFS](er, entry)
|
|
504
659
|
}
|
|
505
660
|
|
|
506
|
-
[FILE] (entry) {
|
|
661
|
+
[FILE] (entry, _) {
|
|
507
662
|
const mode = entry.mode & 0o7777 || this.fmode
|
|
508
663
|
|
|
509
664
|
const oner = er => {
|
|
@@ -570,7 +725,7 @@ class UnpackSync extends Unpack {
|
|
|
570
725
|
})
|
|
571
726
|
}
|
|
572
727
|
|
|
573
|
-
[DIRECTORY] (entry) {
|
|
728
|
+
[DIRECTORY] (entry, _) {
|
|
574
729
|
const mode = entry.mode & 0o7777 || this.dmode
|
|
575
730
|
const er = this[MKDIR](entry.absolute, mode)
|
|
576
731
|
if (er)
|
|
@@ -590,7 +745,7 @@ class UnpackSync extends Unpack {
|
|
|
590
745
|
|
|
591
746
|
[MKDIR] (dir, mode) {
|
|
592
747
|
try {
|
|
593
|
-
return mkdir.sync(dir, {
|
|
748
|
+
return mkdir.sync(normPath(dir), {
|
|
594
749
|
uid: this.uid,
|
|
595
750
|
gid: this.gid,
|
|
596
751
|
processUid: this.processUid,
|
|
@@ -607,7 +762,7 @@ class UnpackSync extends Unpack {
|
|
|
607
762
|
}
|
|
608
763
|
}
|
|
609
764
|
|
|
610
|
-
[LINK] (entry, linkpath, link) {
|
|
765
|
+
[LINK] (entry, linkpath, link, _) {
|
|
611
766
|
try {
|
|
612
767
|
fs[link + 'Sync'](linkpath, entry.absolute)
|
|
613
768
|
entry.resume()
|