Bug 112990 - tar changes mtime when invoked with --atime-preserve
Summary: tar changes mtime when invoked with --atime-preserve
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tar
Version: 9
Hardware: i386
OS: Linux
high
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-01-06 23:32 UTC by rudy
Modified: 2007-03-27 04:13 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-11-09 12:59:50 UTC
Embargoed:


Attachments (Terms of Use)

Description rudy 2004-01-06 23:32:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5)
Gecko/20031007 Firebird/0.7

Description of problem:
mtime is changed on files when invoked with the --atime-preserve switch.

Version-Release number of selected component (if applicable):
tar (GNU tar) 1.13.25

How reproducible:
Always

Steps to Reproduce:
[root@somewhere dir]# stat ffa
  File: `ffa'
  Size: 69              Blocks: 8          IO Block: 4096   Regular File
Device: 3a00h/14848d    Inode: 584178      Links: 1
Access: (0644/-rw-r--r--)  Uid: (  500/rmetzger)   Gid: (  100/   users)
Access: 2003-11-17 20:07:47.000000000 +0100
Modify: 2003-09-04 00:39:45.000000000 +0200
Change: 2004-01-06 01:02:54.000000000 +0100
 
[root@somewhere dir]# tar --atime-preserve -cf test.tar ffa
[root@somewhere dir]# stat ffa
  File: `ffa'
  Size: 69              Blocks: 8          IO Block: 4096   Regular File
Device: 3a00h/14848d    Inode: 584178      Links: 1
Access: (0644/-rw-r--r--)  Uid: (  500/rmetzger)   Gid: (  100/   users)
Access: 2003-11-17 20:07:47.000000000 +0100
Modify: 2003-09-04 00:39:45.000000000 +0200
Change: 2004-01-07 00:24:31.000000000 +0100


    

Actual Results:  see above (mtime was changed)

Expected Results:  mtime should not be changed

Additional info:

Ok, I know this sounds rediculous, BUT:
- this only happens when the file was not just created!!! I tried this
on files some days old (with an atime or mtime older than today, see
above). If you do this on files just created (e.g. atime/mtime is
today, everything works fine! (no bug) I did not try however how old
the file has to be exactly.

IMPACT: This causes big problems in intruder detection programs, such
as tripwire.

Comment 1 Peter Vrabec 2004-11-09 12:59:50 UTC
man tar:
--atime-preserve
              donât change access times on dumped files

-Tar does not change mtime. Even in your example mtime is not changed.
-ctime is changed because tar restore(--atime-preserve) atime.




Note You need to log in before you can comment on or make changes to this bug.