From c6b65ee8a9a57d51956ee462fa1d61fd90d61f40 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 22 Apr 2020 14:22:44 +0200 Subject: Skip PAX global headers Tar archives can contain set two kinds of PAX headers: - local headers that modify the attributes of the next file - global headers that set defaults for all files The later is used "... not widely used", according to tar(5) and has been deliberately not implemented. Some programs (e.g. git-archive) *do* generate them (in the case of git, it stores the commit hash). This commit adds a code path that skips a PAX global header entirely and resumes tar parsing, instead of erroneusly reporting it as an entry. Signed-off-by: David Oberhollenzer --- include/tar.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/tar.h') diff --git a/include/tar.h b/include/tar.h index def36be..af3c9ab 100644 --- a/include/tar.h +++ b/include/tar.h @@ -105,6 +105,7 @@ typedef struct { #define TAR_TYPE_GNU_SPARSE 'S' #define TAR_TYPE_PAX 'x' +#define TAR_TYPE_PAX_GLOBAL 'g' #define TAR_MAGIC "ustar" #define TAR_VERSION "00" -- cgit v1.2.3