Bug 112990 - tar changes mtime when invoked with --atime-preserve
tar changes mtime when invoked with --atime-preserve
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: tar (Show other bugs)
9
i386 Linux
high Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-01-06 18:32 EST by rudy
Modified: 2007-03-27 00:13 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-09 07:59:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description rudy 2004-01-06 18:32:07 EST
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 07:59:50 EST
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.