Subject: kern/21315: File modification time on LFS wrong; at least when using pax
To: None <gnats-bugs@gnats.netbsd.org>
From: Bjoern Labitzke <bcsl@gmx.de>
List: netbsd-bugs
Date: 04/25/2003 07:04:16
>Number:         21315
>Category:       kern
>Synopsis:       File modification time on LFS wrong; at least when using pax
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 25 05:05:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Bjoern Labitzke
>Release:        NetBSD 1.6R (kernel and userland from approx. 23.-24.04.2003)
>Organization:
Bjoern Labitzke  <bcsl@gmx.de>
   Use GPG! (Don't you use envelopes for your letters?)
>Environment:
	
	
System: NetBSD labitzke.homeunix.org 1.6R NetBSD 1.6R (LABITZKE) #1058: Thu Apr 24 10:09:40 CEST 2003 hermit@labitzke.homeunix.org:/usr/local/junk/build1/kernels/LABITZKE i386
Architecture: i386
Machine: i386
>Description:
When copying files with pax to a LFS partition, the modification times
get set to the current time, even if they should be kept.

$ cd /usr/cvs.netbsd
$ ls -lA localsrc/cvstest
total 14
drwxr-xr-x   3 hermit  staff   512 Feb 26 22:35 .
drwxr-xr-x  23 hermit  staff  1024 Apr 25 06:35 ..
drwxr-xr-x   2 hermit  staff   512 Feb 26 22:35 CVS
-rw-r--r--   1 hermit  staff    80 Oct  3  2002 README
-rw-r--r--   1 hermit  staff    25 Oct  3  2002 bar.c
-rw-r--r--   1 hermit  staff    26 Oct  3  2002 baz.c
-rw-r--r--   1 hermit  staff   127 Oct  3  2002 foo.c

Example 1: FFS to FFS copy
$ sudo pax -r -w -pe localsrc /tmp/
$ ls -lA /tmp/localsrc/cvstest
total 14
drwxr-xr-x   3 hermit  staff  512 Feb 26 22:35 .
drwxr-xr-x  23 hermit  staff  512 Apr 25 06:35 ..
drwxr-xr-x   2 hermit  staff  512 Feb 26 22:35 CVS
-rw-r--r--   1 hermit  staff   80 Oct  3  2002 README
-rw-r--r--   1 hermit  staff   25 Oct  3  2002 bar.c
-rw-r--r--   1 hermit  staff   26 Oct  3  2002 baz.c
-rw-r--r--   1 hermit  staff  127 Oct  3  2002 foo.c

Example 2: FFS to LFS copy
$ sudo pax -r -w -pe localsrc /usr/local/temp/cvs.netbsd/
$ ls -lA /usr/local/temp/cvs.netbsd/localsrc/cvstest
total 14
drwxr-xr-x   3 hermit  staff  512 Feb 26 22:35 .
drwxr-xr-x  23 hermit  staff  512 Apr 25 06:35 ..
drwxr-xr-x   2 hermit  staff  512 Feb 26 22:35 CVS
-rw-r--r--   1 hermit  staff   80 Apr 25 06:40 README
-rw-r--r--   1 hermit  staff   25 Apr 25 06:40 bar.c
-rw-r--r--   1 hermit  staff   26 Apr 25 06:40 baz.c
-rw-r--r--   1 hermit  staff  127 Apr 25 06:40 foo.c

But (on the LFS):
$ cd /usr/local/temp/cvs.netbsd/localsrc/cvstest
$ touch -t 01011300 bar.c
$ ls -lA
total 14
drwxr-xr-x   3 hermit  staff  512 Feb 26 22:35 .
drwxr-xr-x  23 hermit  staff  512 Apr 25 06:35 ..
drwxr-xr-x   2 hermit  staff  512 Feb 26 22:35 CVS
-rw-r--r--   1 hermit  staff   80 Apr 25 06:40 README
-rw-r--r--   1 hermit  staff   25 Jan  1 13:00 bar.c
-rw-r--r--   1 hermit  staff   26 Apr 25 06:40 baz.c
-rw-r--r--   1 hermit  staff  127 Apr 25 06:40 foo.c
>How-To-Repeat:
Copy something from FFS to LFS with pax -r -w -pe and find the file
modification times of the targets set to the time of the copy instead
of the times from the sources.
	
>Fix:
Sorry, no idea. But ISTR that I used this command quite some time ago
to do exactly what I did now and it worked. (Quite some time is
something at least half a year ago, maximum two years ago.)
	
>Release-Note:
>Audit-Trail:
>Unformatted: