relative pathname question!

John Chambers jc at minya.UUCP
Wed Aug 10 13:34:54 AEST 1988


In article <5103 at rpp386.UUCP>, jfh at rpp386.UUCP (John F. Haugh II) writes:
> In article <5762 at super.upenn.edu> spolsky at eniac.seas.upenn.edu.UUCP (Joel Spolsky) writes:
> >As far as I can tell, there is NO way to extract tar files with
> >absolute pathnames anywhere except their original positions.
> 
> sure is, and a damned clever one at that.  its called "sub-system root".
> look up chroot(2) in your unix manual.

Or, if you have the source lying about, there's an even better solution,
which I've snuck into the libraries of a few systems.  It is easy to spot
the point at which the code has a pointer to the name of a file about to
be created.  You just insert a line like:
	while (*filename == '/') ++filename;
and recompile.  [The actual name isn't 'filename'; I've forgotten what it 
is.  But no big deal; it's easy to find.]

It works fine, and nobody on your system is ever again bothered by tar tapes
with absolute pathnames.

You might also hit the tar.1 manual page while you're at it.

Too bad we don't all have source.  Is there perhaps a PD version of tar
lurking about somewhere?

-- 
John Chambers <{adelie,ima,maynard,mit-eddie}!minya!{jc,root}> (617/484-6393)

[Any errors in the above are due to failures in the logic of the keyboard,
not in the fingers that did the typing.]



More information about the Comp.unix.wizards mailing list