Bug 19973

Summary: restore does not set access/modification times correctly for immutable files
Product: Base System Reporter: Arjan.deVet <Arjan.deVet>
Component: binAssignee: dwmalone
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Arjan.deVet 2000-07-16 21:20:00 UTC
When restoring some tapes I noticed that some files did not get their
original access and modification timestamps but the current time
instead. I found out that these were all immutable files.

The restore program sets the file flags on restored files with
(f)chflags before setting the times with utimes, causing the utimes call
to fail. By reversing these calls the times get set correctly for
immutable files.

How-To-Repeat: 
Dump the root fs to a file or tape and restore it somewhere else. The
restored kernel file (normally immutable) will have different access and
modification times when compared with the original /kernel file.
Comment 1 dwmalone 2000-07-16 23:09:28 UTC
On Sun, Jul 16, 2000 at 10:10:30PM +0200, Arjan de Vet wrote:

> When restoring some tapes I noticed that some files did not get their
> original access and modification timestamps but the current time
> instead. I found out that these were all immutable files.

The included patch seems reasonable. Anyone object to my committing it?

	David.
Comment 2 dwmalone freebsd_committer freebsd_triage 2000-07-17 00:22:38 UTC
Responsible Changed
From-To: freebsd-bugs->dwmalone

I've committed the patch from -current, I'll close the PR when I merge it to 
RELENG_4.
Comment 3 dwmalone freebsd_committer freebsd_triage 2000-07-21 10:00:19 UTC
State Changed
From-To: open->closed

Committed to HEAD and RELENG_4, thanks.