[net.unix-wizards] tar fix

mel@houxm.UUCP (08/30/83)

On USG UNIX the usual tar trouble is in permission problems in
writing files into directories.  We get around these troubles by
removing the 2 chown() calls in the code.  If you use tar to
back-up your file systems it may make sense to preserve the ownerships
of the files.  However, in the usual case of transfer of files from
one system to another it makes no sense whatever to change the
ownership of the files to whoever on your machine has the same UID
as the owner of the original file on the original system.  If your
system administrator won't remove the chown's from your machine's
official version of tar, do it yourself on your private copy.  It
is just one short file, tar.c, and the 2 calls to chown() obviously
placed and easy to remove (watch the {}'s).
  Mel Haas  ,  houxm!mel

jmc@root44.UUCP (John Collins) (09/15/83)

Personally (running Sys III slowly progressing to V as I get the time), I
changed 'tar' to omit the 'chown' unless the extra letter 'o' is specified.
It is then possible to bring up the original ownership etc if required by
the superuser.

Yes I do know about 'cpio' - but it isn't as portable between different kinds
of hardware.

Another fix I find useful is to optionally bypass checksum errors at the user's
own risk.  He is asked in each case whether he wants to continue.

		John Collins
		Root Computers Ltd
			...!vax135!ukc!root44!jmc

guy@rlgvax.UUCP (Guy Harris) (09/21/83)

The System III "cpio" does have an option to write its control information
out as ASCII BCD data; "cpio -c".  The "find" command's option "-cpio" to
write out each "found" file in "cpio" format to its standard output (this
option is even in the V7 "cpio", but I don't know if it works there) has
an "-ncpio" option (undocumented, of course!) which writes the file in
"cpio -c" format.  Again, I've not tried it so I don't know if it has any
bugs.  (While we're on the subject of undocumented features, "find" has the
option "-inum" - which matches all files with the given inumber - in the
V7 and System III/V versions; Berkeley are the only people that have bothered
to document it.)

	Guy Harris
	{seismo,mcnc,we13,brl-bmd,allegra}!rlgvax!guy

jmc@root44.UUCP (John Collins) (09/22/83)

I'm sorry to disagree with Guy Harris but the '-c' option of 'cpio',
and the '-ncpio' option of 'find' *ISN'T* portable as various versions of
cpio don't work where the 'sscanf' format is copied literally from the
documentation in CPIO(5 or 4 for System III or V respectively).

There should be a 'h' flag with various of the %6o options corresponding
to shorts.....

Ok it's fixed easily enough, but there are enough non-working versions about
not to regard it as portable.

		Sigh.....

			John Collins
			Root Computers Ltd
			....!vax135!ukc!root44!jmc

tjt@kobold.UUCP (T.J.Teixeira) (09/26/83)

************************************************************************
	Yes I do know about 'cpio' - but it isn't as portable between
	different kinds of hardware.

			John Collins
			Root Computers Ltd
				...!vax135!ukc!root44!jmc
************************************************************************

Just use the `c' option to cpio and it will output headers as text strings
rather than binary records.

Actually, I think it was very misguided to use the binary headers as the
default for cpio.  Has anyone else considered changing the default?