summaryrefslogtreecommitdiffstats
path: root/src/file_zip.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-04-19 08:12:39 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-04-19 08:12:39 +0200
commit3f0cf3027472a2929cd076e97999ba6867bbe2d6 (patch)
treeebc6a763dbf7e88cc60816a34c7078637aa60ee2 /src/file_zip.c
parent2326a5f02dcc1c692d0dfa044a8e282290424cae (diff)
PhotoRec: get .zip file date from most recent file
Diffstat (limited to 'src/file_zip.c')
-rw-r--r--src/file_zip.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/file_zip.c b/src/file_zip.c
index 15f91a3..3b869fc 100644
--- a/src/file_zip.c
+++ b/src/file_zip.c
@@ -85,7 +85,8 @@ struct zip_file_entry {
uint16_t unused1:2; /** Unused */
uint16_t compression; /** Compression method */
- uint32_t last_mod; /** Last moditication file time */
+ uint16_t last_mod_time; /** Last moditication file time */
+ uint16_t last_mod_date; /** Last moditication file date */
uint32_t crc32; /** CRC32 */
uint32_t compressed_size; /** Compressed size */
uint32_t uncompressed_size; /** Uncompressed size */
@@ -165,6 +166,12 @@ static int zip_parse_file_entry(file_recovery_t *fr, const char **ext, const uns
le32(file.uncompressed_size),
le32(file.crc32));
#endif
+ {
+ /* Use the more recent file to set the time/date of the recovered archive */
+ const time_t tmp=date_dos2unix(le16(file.last_mod_time), le16(file.last_mod_date));
+ if(fr->time < tmp)
+ fr->time=tmp;
+ }
len = le16(file.filename_length);
if (len)
{