Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cpio(4) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cpio(1)

stat(2)



cpio(4)                          DG/UX R4.11                         cpio(4)


NAME
       cpio - format of cpio archive

DESCRIPTION
       When cpio(1) is used on a generic DG/UX system with the -o option
       (with the -oZ options on a system with DG/UX information security)
       but not the -c option, the header structure of the resulting cpio
       archive is as follows:

       struct hdrcpio {
               short   hmagic,
                       hdev;
               ushort  hino,
                       hmode,
                       huid,
                       hgid;
               short   hnlink,
                       hrdev,
                       hmtime[2],
                       hnamesize,
                       hfilesize[2];
               char    hname[hnamesize rounded to word];
       } Hdr;

       When the -c option is used (-cZ options on a system with DG/UX
       information security), the header information is described by:

            sscanf(Chdr,"%6o%6o%6o%6o%6o%6o%6o%6o%11lo%6o%11lo%s",
                 &Hdr.hmagic, &Hdr.hdev, &Hdr.hino, &Hdr.hmode,
                 &Hdr.huid, &Hdr.hgid, &Hdr.hnlink, &Hdr.hrdev,
                 &Longtime, &Hdr.hnamesize, &Longfile, &Hdr.hname);

       Longtime and Longfile are equivalent to Hdr.hmtime and
       Hdr.hfilesize, respectively.  The contents of each file are recorded
       in an element of the array of varying length structures, archive,
       with other items describing the file.  Every instance of hmagic
       contains the constant 070707 (octal).  The items hdev through
       hmtime have meanings explained in stat(2).  The length of the null-
       terminated pathname hname, including the null byte, is given by
       hnamesize.

       The last record of the archive always contains the name TRAILER!!!.
       Special files, directories, and the trailer are recorded with
       hfilesize equal to zero.

   Information Security Features
       On a system with DG/UX information security, the following
       information applies to trusted cpio binary archives.

       The trusted binary format constants and structures are defined in
       <dgtarchives.h>.

       All records in the trusted binary format are aligned to 32-bit word
       boundaries.

       The trusted binary format consists of a site security attribute
       section followed by one or more file sections.  The site security
       attribute section is written to the output file every time cpio -o is
       invoked.  The site security attribute section consists of a header,
       optionally followed by a number of attributes:

       typedef
       struct {
              unsigned short          tmagic;      /* SECBHDRMAGIC */
              dgtcpiobinhdrtype   ttype;       /* SECBHDRHDR0  */
              dgtcpiobinhdrrev    trev;        /* SECBHDRREVCURRENT */
              short                   tnattrs;
              }
           /*<----------------*/
              dgtcpiobinhdr;
           /*>----------------*/

       tnattrs is the number of site security attributes that follow the
       site security header.  A site security attribute consists of an
       attribute header record which describes the attribute and its length
       in bytes.  The attribute itself immediately follows the attribute
       header record.

       typedef
       struct {
              char                    Ttype[8];
              char                    Tsize[8];
              }
           /*<-------------*/
              dgtcpioattr;
           /*>-------------*/

       A file section consists of an identifying header, followed by a
       second informational header optionally followed by a number of
       attributes, the pathname and finally the file contents.

       typedef
       struct {
              unsigned short          tmagic;      /* SECBHDRMAGIC */
              dgtcpiobinhdrtype   ttype;       /* SECBHDRHDR0  */
              dgtcpiobinhdrrev    trev;        /* SECBHDRREVCURRENT */
              short                   tnattrs;
              }
           /*<----------------*/
              dgtcpiobinhdr;
           /*>----------------*/


       typedef
       struct {
              devt                   tdev;
              inot                   tino;
              modet                  tmode;
              uidt                   tuid;
              gidt                   tgid;
              nlinkt                 tnlink;
              devt                   trdev;
              timet                  tmtime;

              /*
               *  The pathname immediately follows the last attribute
               *  following this header.
               */

              ssizet                 tnamesize;

              /*
               *  The file contents should immediately follow the pathname.
               */

              dgtcpiofilesizet     tfilesize;

              unsigned char           tufiasubtype;
              unsigned char           tufiasecpattrs;
              unsigned char           reservedbyte[2];
              modet                  textendedmode;
              unsigned long           tmaxcpdblocks;
              unsigned long           tmaxcpdfilenodes;
              }
           /*<-------------------*/
              dgtcpiobinhdrest;
           /*>-------------------*/

       dgtcpiobinhdr.tnattrs is the number of file security attributes
       that follow the second (informative) file section header.  A file
       security attribute consists of an attribute header record which
       describes the attribute and its length in bytes.  The file security
       attribute immediately follows the file security attribute header
       record.

       typedef
       struct {
              char                    Ttype[8];
              char                    Tsize[8];
              }
           /*<-------------*/
              dgtcpioattr;
           /*>-------------*/

       The pathname follows (dg_tcpio_bin_hdrest.t_namesize bytes long),
       followed by the file contents (dg_tcpio_bin_hdrest.t_filesize bytes
       long).

FILES
       /usr/include/archives.h
       /usr/include/dgtarchives.h (with DG/UX information security only)

SEE ALSO
       cpio(1), stat(2).


Licensed material--property of copyright holder(s)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026