From ortmann@localhost.nodak.edu  Tue Aug 29 21:46:53 1995
Received: from localhost.nodak.edu (ndts3.pt09.ndsu.NoDak.edu [134.129.108.141])
          by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id VAA09597
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 29 Aug 1995 21:46:45 -0700
Received: (from ortmann@localhost) by localhost.nodak.edu (8.6.12/8.6.9) id XAA00310; Tue, 29 Aug 1995 23:44:25 -0500
Message-Id: <199508300444.XAA00310@localhost.nodak.edu>
Date: Tue, 29 Aug 1995 23:44:25 -0500
From: Daniel Ortmann <ortmann@localhost.nodak.edu>
Reply-To: ortmann@localhost.nodak.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: tar not restoring permissions properly
X-Send-Pr-Version: 3.2

>Number:         714
>Category:       bin
>Synopsis:       tar is not restoring permissions...possibly when the sticky but is set
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 29 21:50:01 PDT 1995
>Closed-Date:    Tue Aug 29 22:09:53 PDT 1995
>Last-Modified:  Tue Aug 29 22:20:01 PDT 1995
>Originator:     Daniel Ortmann
>Release:        FreeBSD 2.0-BUILT-19950623 i386
>Organization:
North Dakota State University
>Environment:

No special environment is needed to reproduce this bug.

>Description:

When a directory has the sticky bit set and it is tar'red, sent through
the standard output, the output is caught in a subshell, and untar'red
in a different directory ...

... then the permissions are restored incorrectly on the directory.

I noticed while creating a backup root partition.

>How-To-Repeat:

$ mkdir asdf fdsa
$ chmod 1777 asdf
$ tar cf - asdf | ( cd fdsa ; tar xvf - )
$ /bin/ls -l fdsa

drwx-----T  2 ortmann  wheel  512 Aug 29 23:43 asdf


>Fix:
	
I do not know of a fix for this problem.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: nate 
State-Changed-When: Tue Aug 29 22:09:53 PDT 1995 
State-Changed-Why:  
It is necessary to use the 'p' arguement to restore the exact 
permissions with tar. 


From: Nate Williams <nate@rocky.sri.MT.net>
To: ortmann@localhost.nodak.edu
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/714: tar not restoring permissions properly
Date: Tue, 29 Aug 1995 23:11:52 -0600

 > >Synopsis:       tar is not restoring permissions...possibly when the sticky but is set
 > >How-To-Repeat:
 > 
 > $ mkdir asdf fdsa
 > $ chmod 1777 asdf
 > $ tar cf - asdf | ( cd fdsa ; tar xvf - )
 > $ /bin/ls -l fdsa
 > 
 > drwx-----T  2 ortmann  wheel  512 Aug 29 23:43 asdf
 > 
 > 
 > >Fix:
 > 	
 > I do not know of a fix for this problem.
 
 Try this:
 $ mkdir asdf fdsa
 $ chmod 1777 asdf
 $ tar cf - asdf | ( cd fdsa ; tar xpvf - )
 $ /bin/ls -l fdsa
 
 Note the addition of 'p' to the arguement list.  It works on a 2.0
 system as both root and a regular user.
 
 
 Nate
>Unformatted:
