Only include up to 4 octal digits of file mode info in tar files.

The fifth digit (S_IFMT) is used for the file type (e.g. S_IFDIR=040000
for a directory), which in the tar format is handled separately in
the type field.  This digit is generally ignored by GNU tar and
other implementations, but confuses midnight commander.
Fixes issue #384.
This commit is contained in:
Alex Shinn 2017-01-10 22:17:25 +09:00
parent 71b00779bc
commit 6e99306ccd

View file

@ -160,7 +160,7 @@
(tar-ustar-version-set! tar "00") (tar-ustar-version-set! tar "00")
(cond (cond
(st (st
(tar-mode-set! tar (file-mode st)) (tar-mode-set! tar (bitwise-and #o7777 (file-mode st)))
(tar-uid-set! tar (file-owner st)) (tar-uid-set! tar (file-owner st))
(tar-gid-set! tar (file-group st)) (tar-gid-set! tar (file-group st))
(tar-owner-set! tar (file-owner-or-nobody st)) (tar-owner-set! tar (file-owner-or-nobody st))