Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: Need help preserving permissions when using tar? Message-ID: <2466@sun.uucp> Date: Sun, 21-Jul-85 19:02:07 EDT Article-I.D.: sun.2466 Posted: Sun Jul 21 19:02:07 1985 Date-Received: Wed, 24-Jul-85 07:28:50 EDT References: <495@men1.UUCP> <2424@sun.uucp> <288@mit-priam.UUCP> Organization: Sun Microsystems, Inc. Lines: 17 > >The tar in 4.2bsd (and maybe other Berkeley releases) puts directory > >permissions into the tar file and creates the directories with those > >permissions when you read the tar file. > > But it only sets ownerships if the user who extracts is root. That's because the "chown" system call is privileged in V7 and 4.xBSD and "tar" doesn't run set-UID "root". Be grateful; the "tar" in System III will set ownerships under any circumstances because the "chown" system call isn't privileged. This is lousy because you may have gotten a "tar" tape from another site, and you really don't want the files owned by whatever random person has the same user ID as the person who owned the files on the original machine. The System V "tar" has a "o" flag (which, alas, conflicts with the 4.xBSD "tar"s "o" flag, which tells it not to put directory information on the tape) that tells it not to change the ownership of files. Guy Harris