diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-24 13:36:50 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-24 18:10:34 +0200 |
commit | 4fdfd1f62a9d50298b0bb71e8bea04174af4a3ab (patch) | |
tree | d511b488ce77ef2b0b84b26ead69a1d01375491c /include | |
parent | 30fbd496a1793b4374873144432f9b7a996a689d (diff) |
Fix processing of tar mtime on 32 bit systems
struct stat uses time_t to store time values. On some 32 bit systems,
this may be a 32 bit integer.
This patch adds a broken-out 64 bit time value to tar_header_decoded_t
and makes sure to clamp the value to +/- (2^32 - 1) if required when
writing it back to a struct stat.
Reported-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r-- | include/tar.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/tar.h b/include/tar.h index 5ac0763..e6a506a 100644 --- a/include/tar.h +++ b/include/tar.h @@ -74,6 +74,10 @@ typedef struct { uint64_t record_size; bool unknown_record; tar_xattr_t *xattr; + + /* broken out since struct stat could contain + 32 bit values on 32 bit systems. */ + int64_t mtime; } tar_header_decoded_t; #define TAR_TYPE_FILE '0' |