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


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

.

Last update: 1997-05-20


								9945-2-18

	Class: Editorial defect

 _____________________________________________________________________________



	Topic:			pax
	Relevant Sections:	4.48.2


Defect Report:
-----------------------
 
          In Section 4.48.2  -  Description  {of  pax},  the  standard 
          states that ``[i]f an extracted file is of  type  directory, 
          the file hierarchy rooted at that file shall be extracted as 
          well.'' [Draft 12 of ISO/IEC 9945-2:1993  (July  1992),  p. 
          400, lines 7703-7705] 
 
          And then: 
 
               if  intermediate  directories  are  necessary   to 
               extract  an  archive  member,  pax  shall  perform 
               actions equivalent  to  the  POSIX.1  {8}  mkdir() 
               function, called with the following arguments: 
 
                    -    The intermediate directory used  as  the 
                         path argument. 
 
                    -    The value of the bitwise inclusive OR of 
                         S_IRWXU, S_IRWXG,  and  S_IRWXO  as  the 
                         mode argument. 
 
          [Ibid., p. 401, lines 7728-7733] 
 
          Assuming you have a ustar archive with the following members 
          foo/bar and foo/blat, and you extract them using the command 
          ``pax -r foo <paxfile.''  Now,  if  I  extract  foo/bar  and 
          foo/blat explicitly, everything is  fine  because  directory 
          foo is created with execute permissions. 
 
          However, if I extract only foo (and thus its descendants  as 
          well), I run into problems because without the -p e or -p  p 
          flags set, the  execute  permissions  will  not  be  set  on 
          directory foo: ``[...] otherwise,  the  attribute  shall  be 
          determined as part of the normal file creation  action  (see 
          2.9.1.4).'' [Ibid., p. 403,  lines  7819-7821]   In  Section 
          2.9.1.4 - File Read, Write and Creation, the standard states 
          that: 
 
               the file's permission bits are set to: 
 
                    S_IROTH|S_IWOTH|S_IRGRP|S_IWGRP|S_IRUSR|S_IWUSR 
 
               (see POSIX.1 {8} 5.6.1.2)  except  that  the  bits 
               specified by the process's file mode creation mask 
               are cleared. 
 
          [Ibid.,  p.  96,  lines   3424-3427]    In   this   section, 
          directories are not treated differently than regular  files. 
          The  mkdir  utility  explicitly  adds  the  needed   execute 
          permissions, as does pax on intermediate directories. 
 
          Is the ``spirit'' of the standard to create explicitly-named 
          directories in this manner, or may they have  their  execute 
          permissions set? 
 

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

The standard does not require that the directory have the mode specified
until after pax has exited. This allows the implementation to leave a
more useful mode in place until it completes it processing, then change
it to the specified mode. See Section E.4.48.

Concern over the wording of this section of the standard has been
forwarded to the Sponsors of the standard.

Rationale for Interpretation:
-----------------------------

None.
 _____________________________________________________________________________