From 10f343ea814f5c18a0913997904ee11cd9b7da24 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 3 Aug 2014 03:02:03 +0000 Subject: archive: honor tar.umask even for pax headers git archive's tar format uses extended pax headers to encode metadata into the archive. Most tar implementations correctly treat these as metadata, but some that do not understand the pax format extract these as files instead. Apply the tar.umask setting to these entries to prevent tampering by other users. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- t/t5004-archive-corner-cases.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 't') diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh index 67f3b54bed..4461c961a9 100755 --- a/t/t5004-archive-corner-cases.sh +++ b/t/t5004-archive-corner-cases.sh @@ -113,4 +113,9 @@ test_expect_success 'archive empty subtree by direct pathspec' ' check_dir extract sub ' +test_expect_success 'archive applies umask even for pax headers' ' + git archive --format=tar HEAD >archive.tar && + ! grep 0666 archive.tar +' + test_done -- cgit v1.2.3