[hackers] [sbase] tar: compatibility, treat reserved type as regular file || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sun, 10 May 2015 13:58:43 +0200 (CEST)

commit 590f34c4a9a4dd41becb8868240f3c3151ae3f93
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun May 10 11:13:25 2015 +0200

    tar: compatibility, treat reserved type as regular file
    
    References:
    - http://www.gnu.org/software/tar/manual/html_node/Standard.html
    - http://pubs.opengroup.org/onlinepubs/009695399/basedefs/tar.h.html

diff --git a/tar.c b/tar.c
index 6c9bcfc..8dbce22 100644
--- a/tar.c
+++ b/tar.c
_AT_@ -32,7 +32,8 @@ enum Type {
         CHARDEV = '3',
         BLOCKDEV = '4',
         DIRECTORY = '5',
- FIFO = '6'
+ FIFO = '6',
+ RESERVED = '7'
 };
 
 struct header {
_AT_@ -273,6 +274,7 @@ unarchive(char *fname, ssize_t l, char b[BLKSIZ])
         switch (h->type) {
         case REG:
         case AREG:
+ case RESERVED:
                 if ((mode = strtol(h->mode, &p, 8)) < 0 || *p != '\0')
                         eprintf("strtol %s: invalid number\n", h->mode);
                 fd = open(fname, O_WRONLY | O_TRUNC | O_CREAT, 0644);
Received on Sun May 10 2015 - 13:58:43 CEST

This archive was generated by hypermail 2.3.0 : Sun May 10 2015 - 14:00:14 CEST