[comp.sys.hp] Serious tar bug

gdykes@theory.tn.cornell.edu (Gene Dykes) (01/03/91)

Would somebody please try to duplicate this?  I'm running HPUX 7.0
on a 9000/835.  It would be interesting to know how widespread this
bogosity is...

HP, Please note!

I have uncovered a very serious error in tar.  When told to follow
symbolic links, it sometimes gets confused and starts dumping bizarrely,
even though there is no recursion in the directory structure.

To illustrate, the following commands

    mkdir d1
    cd d1
    mkdir d2 d3
    cd d2
    ln -s ../d3 d4
    cd ../..

produce a tree that looks like this:

				      d1
                                      |\
				      | \
				      |  \
                                     d2  d3
				      |   ^
				      |   |
				      |   |
                                     d4---
				      
				     

The only critical feature here is that there be a directory which is a
symbolic link to a subdirectory of the parent's parent, in this case
d4 points to d3.  Note that this is not recursive.  We would expect that d3
will get dumped twice, but instead, tar gets very confused and starts dumping
all sorts of bizarre areas of the users file system.

To see for yourself, execute the following command after creating the
tree with the above script, but keep your finger poised on your kill key...

tar chvf /dev/null d1

-- 
Gene Dykes, gdykes@theory.tn.cornell.edu

schell@llandru.ucdavis.edu (Stephan Schell) (01/03/91)

I verified the behavior on our 835 running 7.0 as described by the 
original poster.  I also tried it on our DECstation 5000/200 running
Ultrix 4.0 and did NOT observe any buggy behavior.  Anyone from HP
listening?

--
-------------------------------------------------------------------------------
Stephan Schell                          schell@llandru.eecs.ucdavis.edu
Dept. of Electrical Engineering         {ucbvax,lll-crg}!ucdavis!llandru!schell
      &  Compter Science				
University of California, Davis         (916) 752-1326

corrigan@weber.ucsd.edu (Michael J. Corrigan) (01/03/91)

In article <1991Jan2.221811.26074@batcomputer.tn.cornell.edu> gdykes@theory.tn.cornell.edu (Gene Dykes) writes:
>Would somebody please try to duplicate this?  I'm running HPUX 7.0
>on a 9000/835.  It would be interesting to know how widespread this
>bogosity is...
>
	It also occurs on the 400 series (7.03) ( they really are compatible )

	4.3 BSD dumps a file in d4 twice which is what you expected.

	I also checked a shortfilename filesystem and tar gets even
	more confused there.

	I imagine this is a trivial recompile to fix on the longfilename
	filesystem.

kingsley@hpwrce.HP.COM (Kingsley Morse) (01/04/91)

HP should be able to help with this. I suggest you ask at your local HP office
about a support service called "SupportLine". It allows you to contact Unix
engineers via e-mail. If you post a question on SupportLine about tar, they 
should be able to help.