Ensure packed symlinks have size zero as required by GNU tar
This commit is contained in:
parent
71439bf2df
commit
bbb3e91a44
2 changed files with 3 additions and 2 deletions
2
pack.js
2
pack.js
|
@ -117,7 +117,7 @@ Pack.prototype.entry = function (header, buffer, callback) {
|
|||
|
||||
var self = this
|
||||
|
||||
if (!header.size) header.size = 0
|
||||
if (!header.size || header.type === 'symlink') header.size = 0
|
||||
if (!header.type) header.type = modeToType(header.mode)
|
||||
if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE
|
||||
if (!header.uid) header.uid = 0
|
||||
|
|
|
@ -110,7 +110,8 @@ test('types', function (t) {
|
|||
uname: 'maf',
|
||||
gname: 'staff',
|
||||
uid: 501,
|
||||
gid: 20
|
||||
gid: 20,
|
||||
size: 9 // Should convert to zero
|
||||
})
|
||||
|
||||
pack.finalize()
|
||||
|
|
Loading…
Reference in a new issue