ClosestStorm / rar2fs

Automatically exported from code.google.com/p/rar2fs
GNU General Public License v3.0
0 stars 0 forks source link

rar2fs returns wrong timestamp with legacy format. #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Prepare file.

 * NOTE : "l" is aslias for "ls -lAF --full-time".

# l
total 1932
-rw-r--r-- 1 root root 1977432 2014-07-01 21:00:52.207498641 +0900 
winrar-x64-501.exe

2. Create RAR legacy format file contains that file.

 * NOTE : WinRAR creates legacy format of archive file by default unless user specifies -ma5 option.

# WINEPREFIX=/mnt/WINRAR_ROOT wine 'C:\Program Files\WinRAR\Rar.exe' a -m0 
RAR.rar winrar-x64-501.exe

3. Mount archive.
# mkdir TEST
# rar2fs -o ro,allow_other RAR.rar TEST

4. Listing file.

# l TEST/
total 1932
-rw-r--r-- 1 root root 1977432 2014-07-01 21:01:17.207498600 +0900 
winrar-x64-501.exe

What is the expected output? What do you see instead?

 - It must be '2014-07-01 21:00:52.207498641 +0900', but it returns '2014-07-01 21:01:17.207498600 +0900' as +25 seconds after than original.

What version of the product are you using? On what operating system?

 - OS : Gentoo x86_64

# rar2fs -V
rar2fs v1.20.0 (DLL version 6)    Copyright (C) 2009-2014 Hans Beckerus
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under
certain conditions; see <http://www.gnu.org/licenses/> for details.
FUSE library version: 2.9.3
fusermount version: 2.9.3
using FUSE kernel interface version 7.19

# emerge --search unrar
Searching...    
[ Results for search key : unrar ]
[ Applications found : 3 ]

*  app-arch/unrar
      Latest version available: 5.1.5
      Latest version installed: 5.1.5
      Size of files: 210 kB
      Homepage:      http://www.rarlab.com/rar_add.htm
      Description:   Uncompress rar files
      License:       unRAR

Please provide any additional information below.

 - I'll attach sample file to reproduce this issue.

Original issue reported on code.google.com by jyhpsy...@gmail.com on 1 Jul 2014 at 12:11

Attachments:

GoogleCodeExporter commented 9 years ago
It may be not a bug of rar2fs or unrar, but wine... I'll check it some more.

Original comment by jyhpsy...@gmail.com on 12 Jul 2014 at 11:35

GoogleCodeExporter commented 9 years ago
From what I can tell WinRAR also reports the time as '2014-07-01 21:01:17' so I 
would say this is not a problem in rar2fs.

Original comment by hans.bec...@gmail.com on 16 Jul 2014 at 4:18

GoogleCodeExporter commented 9 years ago
This issue will be tagged as 'invalid' until some more information can be 
presented that would indicate this being a bug in rar2fs.

Original comment by hans.bec...@gmail.com on 17 Jul 2014 at 7:43

GoogleCodeExporter commented 9 years ago
OK, I can reproduced why it occurs.

I used 'right_timezone' USE flag when compiling gentoo system. This flag is 
applied to sys-libs/timezone-data package. According to 
http://gport.net/use/right_timezone/, when using this USE flag and set timezone 
data to right/*/*, it applies 'leap seconds' when treating timestamp, thus it 
causes returning different timestamp by several seconds compared with legacy 
POSIX timestamp.

I don't know why that behavior only occurs with legacy format, but I guess it 
is WINE's bug on timestamp-related API functions. It's NOT rar2fs' bug - it 
always returns correct timestamp.

Original comment by jyhpsy...@gmail.com on 3 Sep 2014 at 11:18

GoogleCodeExporter commented 9 years ago
Thanks for taking your time to verify the root cause and confirming that this 
is not a bug in rar2fs.

Original comment by hans.bec...@gmail.com on 3 Sep 2014 at 12:27