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
This commit is contained in:
parent
9d95321f0b
commit
590f34c4a9
4
tar.c
4
tar.c
|
@ -32,7 +32,8 @@ enum Type {
|
||||||
CHARDEV = '3',
|
CHARDEV = '3',
|
||||||
BLOCKDEV = '4',
|
BLOCKDEV = '4',
|
||||||
DIRECTORY = '5',
|
DIRECTORY = '5',
|
||||||
FIFO = '6'
|
FIFO = '6',
|
||||||
|
RESERVED = '7'
|
||||||
};
|
};
|
||||||
|
|
||||||
struct header {
|
struct header {
|
||||||
|
@ -273,6 +274,7 @@ unarchive(char *fname, ssize_t l, char b[BLKSIZ])
|
||||||
switch (h->type) {
|
switch (h->type) {
|
||||||
case REG:
|
case REG:
|
||||||
case AREG:
|
case AREG:
|
||||||
|
case RESERVED:
|
||||||
if ((mode = strtol(h->mode, &p, 8)) < 0 || *p != '\0')
|
if ((mode = strtol(h->mode, &p, 8)) < 0 || *p != '\0')
|
||||||
eprintf("strtol %s: invalid number\n", h->mode);
|
eprintf("strtol %s: invalid number\n", h->mode);
|
||||||
fd = open(fname, O_WRONLY | O_TRUNC | O_CREAT, 0644);
|
fd = open(fname, O_WRONLY | O_TRUNC | O_CREAT, 0644);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user