Subject: Re: restore asks "set owner/mode" stupid question
To: Frederick Bruckman <fredb@immanent.net>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-userlevel
Date: 01/07/2005 17:11:27
On Mon, Jan 03, 2005 at 11:54:23AM -0600, Frederick Bruckman wrote:
> When running "restore" with -x or -i (but not -r), it always prompts 
> you near the end of the process with a "set owner/mode for '.'"?  As 
> pointed out by VaX#n8 in PR bin/24690 (and others), this can be quite 
> annoying, if say, you were hoping to accomplish a dump/restore -x 
> pipeline unattended.
> 
> The issue is this: Because restore always restores all intervening 
> directories, it will always "restore" ".".  But if you are only 
> extracting a few files from the dump in, say, "/tmp", you really don't 
> want the permissions on the current directory (/tmp), to be changed. 
> On the other hand, if you're using "-x" to extract an entire file 
> system, you do. Interrogating the user, though, isn't the unix way, 
> and it isn't a robust solution.  Particularly, since it comes out of 
> nowhere, an admin is likely to answer wrongly.
> 
> So, I propose letting restore figure out and perform the recommended 
> practice all by itself:  In the patch below, the implicit dot-dir 
> (when no arguments are given) will be extracted, the explicit dot-dir 
> will be extracted (i.e.: when "." is supplied as an argument), but the 
> incidental, intervening dot-dir will not. Of course I would update the 
> man page, too.

I'm always nervous when touching the behavior of such old tools, but I can't
see any problem with the changes you propose.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--