restore tar archives with different uid?

Donald Nichols ceilidh!dnichols at uunet.uu.net
Sun Aug 26 13:49:07 AEST 1990


"Chad R. Larson says:"
> 
> In article <1740 at yenta.alb.nm.us> dt at yenta.alb.nm.us (David B. Thomas) writes:
> +---------------
> | Is there a way to restore a tar archive, but force all the files
> | thus created to be owned by you?
> +---------------
> Well, you don't tell which version of tar you are playing with (DOS? SysV?
> BSD?), but it sure sounds like a RTFM question to me.
> 
> SysVr3.2 TAR(1) partial extract, speaking of key arguments:
> 
>     "o" - Causes the extracted files to assume the owner and group ID
> 	  of the user running the program rather than those on the
> 	  archive tape.

	But - for example - TFM for 3.51 unix for the unix-pc from at&t
(that's actually SysVR2 + some Berkely stuff) DOES NOT MENTION the -o
option.  Yes - it does work, but no - it is not documented.  This may have
also been the case on the system which the original poster uses.

	IMHO, this is a misfeature, since it is easy for someone to
partially extract an archive and not be able to read it. (At least, he can
get rid of it :-)

	When AT&T, in their great wisdom, decided to let the Great Unwashed
User change the ownership of files that s/he owns, they should have modified
tar so that if the uid is not 0, the -o option is automatically set.  This
would preserve the behavior found under V7 and BSD.  Perhaps also they could
have made the -o option invert THIS behavior for non-root invokers.  Under
V7 and BSD, they could get away with blindly chown(2)ing each file or
directory created, knowing that it would not work for a non-root user.
SysV, however, produces problems, and should not have this as the DEFAULT
behavior.

> -- 
> Chad R. Larson          ...{mcdphx,asuvax}!anasaz!chad or chad at anasaz.UUCP
> Anasazi, Inc. - 7500 North Dreamy Draw Drive, Suite 120, Phoenix, Az 85020
> (602) 870-3330            "I read the news today, oh boy!"  -- John Lennon
> 


-- 
Donald Nichols (DoN.)		| Voice (Days):	(703) 664-1585
D&D Data			| Voice (Eves):	(703) 938-4564
Disclaimer: from here - None	| Email:	<dnichols at ceilidh.beartrack.com>
	--- Black Holes are where God is dividing by zero ---



More information about the Comp.unix.wizards mailing list