Xref: utzoo comp.bugs.2bsd:186 comp.bugs.4bsd:1429
Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uakari.primate.wisc.edu!gem.mps.ohio-state.edu!apple!voder!wlbr!wlv.imsd.contel.com!sms
From: sms@wlv.imsd.contel.com (Steven M. Schultz)
Newsgroups: comp.bugs.2bsd,comp.bugs.4bsd
Subject: bug in tar's handling of absolute paths
Message-ID: <37678@wlbr.IMSD.CONTEL.COM>
Date: 3 Oct 89 20:38:20 GMT
Sender: news@wlbr.IMSD.CONTEL.COM
Reply-To: sms@wlv.imsd.contel.com (Steven M. Schultz)
Followup-To: comp.bugs.2bsd
Organization: Contel Federal Systems
Lines: 40

Subject: bug in tar absolute pathname handling +FIX
Index:	bin/tar.c 2.10BSD

Description:
	Tar will not correctly handle absolute paths unless
	you start them from /

Repeat-By:
	cd /usr/src/sys
	tar c /usr

Fix:
	Apply the following patch.

-------------------------- CUT HERE -----------------------
*** tar.c.orig	Sat Apr 26 07:35:13 1986
--- tar.c	Tue Oct  3 15:27:47 1989
***************
*** 361,367 ****
  			argv++;
  			continue;
  		}
! 		parent = wdir;
  		for (cp = *argv; *cp; cp++)
  			if (*cp == '/')
  				cp2 = cp;
--- 361,373 ----
  			argv++;
  			continue;
  		}
! 
! 		if (*argv[0] == '/'){
! 			parent = "";
! 		} else {
! 			parent = wdir;
! 		}
! 
  		for (cp = *argv; *cp; cp++)
  			if (*cp == '/')
  				cp2 = cp;