bin/39849: /sbin/restore fails to overwrite files with schg
flag set
Crist J. Clark
cristclark at comcast.net
Thu May 24 20:20:06 UTC 2007
The following reply was made to PR bin/39849; it has been noted by GNATS.
From: "Crist J. Clark" <cristclark at comcast.net>
To: Nicolas Rachinsky <nicolas-2007 at rachinsky.de>
Cc: bug-followup at FreeBSD.org, mad1 at tapil.com
Subject: Re: bin/39849: /sbin/restore fails to overwrite files with schg flag set
Date: Thu, 24 May 2007 12:53:15 -0700
On Thu, May 24, 2007 at 02:26:21PM +0200, Nicolas Rachinsky wrote:
> Hallo,
>
> At 03:15 AM 6/27/2002, Crist J. Clark wrote:
> > # chflags -R 0 /filesystem/path
> >
> >Before a restore(8) is fairly trivial.
>
> But restore does not set all the flags again.
>
> So you either have to loose some flags or some file changes if you
> restore a multi level backup.
>
> Or you restore the flags manually.
>
> I can't believe this. What am I missing?
What flags does restore(8) not preserve?
And I think only a,
# chflags -R noschg /filesystem/path
Is really necessary.
But there still can be a problem. If you do "chflags -R",
you will lose the flag on any file that doesn't get touched
by the restore(8).
You could use find(1) to generate a list and then use the
list to reset the flags after. But that is a kludge.
An option on dump(8) to force rewriting on schg files (when
securelevel(8) allows) is probably appropriate, but as
discussed, when you start to consider directories, it becomes
non-trivial to implement.
Unfortunately, this PR is coming up on its fifth birthday
and I don't do FreeBSD work anymore. Feel free to submit
patches against a more modern CURRENT and STABLE.
--
Crist J. Clark | cjclark at alum.mit.edu
More information about the freebsd-bugs
mailing list