WG15 Defect Report Ref: 9945-2-16
Topic: pax


This is an approved interpretation of 9945-2:1993.

.

Last update: 1997-05-20


								9945-2-16
	Class: No change


 _____________________________________________________________________________



	Topic:			pax
	Relevant Sections:	4.48.2


Defect Report:
-----------------------

          In Section 4.48.2  -  Description  {of  pax},  the  standard 
          states that, when using pax in read  mode,  ``[a]ny  of  the 
          various names in the archive that represent a  file  can  be 
          used to select the file for extraction.''  [Draft 12 of ISO/IEC 
          9945-2:1993 (July 1992), p. 401, lines 7742-7744] 
 
          Does this mean that if the following steps were performed: 
 
               echo testing >a 
               ln a b 
               pax -wf foo -x ustar a b 
 
          and then, in a clean directory the  following  command  were 
          performed: 
 
               pax -rf foo b 
 
          the file ``b'' will be created, with  the  contents  of  the 
          original file ``a''?  Historical versions of  tar  will  not 
          extract the file, but will complain about not being able  to 
          link to the file  ``a''.   Given  the  extended  tar  format 
          defined by POSIX.1, it would be prohibitively  expensive  to 
          re-read the archive to locate the contents  of  file  ``a.'' 
          This is not a problem with cpio format, since  the  contents 
          of the file ``a'' may appear twice. 
 
          According to Section 1.1 - Scope: 
 
               The facilities provided are  based  on  historical 
               models of the following documents:  the  System  V 
               Interface Definition {B35}; the  BSD  User  Manual 
               {B41}; the X/OPEN  Portability  Guide  {B44};  and 
               documentation for the KornShell  {B36}.   Emphasis 
               is placed on standardizing existing  practice  for 
               existing users, with changes or additions  limited 
               to correcting deficiencies in the following areas: 
 
                    (a)  Support for international character sets 
                         and  other  localization   requirements, 
                         such   as   date   formats,    collation 
                         sequences, etc.. 
 
                    (b)  Reconciliation  of  differences  between 
                         the historical implementations. 
 
                    (c)  Elimination   of   system   or    device 
                         dependencies. 
 
                    (d)  Corrections  of  features   that   could 
                         reduce       system       or        user 
                         security/integrity. 
 
          [Ibid., p. 2, lines 35-47] 
 
          Does the standard mean to document historical  practice,  or 
          is this an example of item (d) in the above list? 
 

WG15 response for 9945-2:1993 
-----------------------------------

The standard implies that the implementation must rewind the
archive and restore the contents from the original file. The relevant
text is from section 4.48.2, lines 7705-7708:

  If the selected archive format supports the specification of linked
  files, it shall be an error if these files cannot be linked when the
  archive is extracted. Any of the various names in the archive that
  represent a file can be used to select the file for extraction.

The first sentence pertains to situations in which the file
is extracted but the link cannot be created, because the
second sentence supports selection of any link name for use in
extracting the actual file.

Rationale for Interpretation:
-----------------------------
Historical practice does not apply in this case because the standard 
does not attempt to specify the behavior of historical tar utilities.  
A new utility, pax, is being specified.
 _____________________________________________________________________________