From 6e99306ccd9c2d989a46f8cee7d7fa58c65f5498 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Tue, 10 Jan 2017 22:17:25 +0900 Subject: [PATCH] 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. --- lib/chibi/tar.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chibi/tar.scm b/lib/chibi/tar.scm index d45b3637..961cf4b7 100644 --- a/lib/chibi/tar.scm +++ b/lib/chibi/tar.scm @@ -160,7 +160,7 @@ (tar-ustar-version-set! tar "00") (cond (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-gid-set! tar (file-group st)) (tar-owner-set! tar (file-owner-or-nobody st))