diff options
author | Guillem Jover <guillem@debian.org> | 2018-11-29 01:28:32 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2019-01-22 13:41:55 +0100 |
commit | 683d5a21fb749d49873d04639732a69a3b41f59b (patch) | |
tree | ae2783364313217f6a816053d415bc3c52fc6bd9 /lib | |
parent | 0118b3c7052327f657b9a05cd0b8988775b24a42 (diff) | |
download | dpkg-683d5a21fb749d49873d04639732a69a3b41f59b.tar.gz |
libdpkg: Detect unsupported tar entry types to give better error messages
We know what we do not support, let's detect and give better diagnostics
so that users get even less confused.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dpkg/tarfn.c | 23 | ||||
-rw-r--r-- | lib/dpkg/tarfn.h | 9 |
2 files changed, 32 insertions, 0 deletions
diff --git a/lib/dpkg/tarfn.c b/lib/dpkg/tarfn.c index 8e3b6e545..afcce0ee5 100644 --- a/lib/dpkg/tarfn.c +++ b/lib/dpkg/tarfn.c @@ -530,6 +530,29 @@ tar_extractor(struct tar_archive *tar) case TAR_FILETYPE_GNU_LONGNAME: status = tar_gnu_long(tar, &h, &next_long_name); break; + case TAR_FILETYPE_GNU_VOLUME: + case TAR_FILETYPE_GNU_MULTIVOL: + case TAR_FILETYPE_GNU_SPARSE: + case TAR_FILETYPE_GNU_DUMPDIR: + status = dpkg_put_error(&tar->err, + _("unsupported GNU tar header type '%c'"), + h.type); + errno = 0; + break; + case TAR_FILETYPE_SOLARIS_EXTENDED: + case TAR_FILETYPE_SOLARIS_ACL: + status = dpkg_put_error(&tar->err, + _("unsupported Solaris tar header type '%c'"), + h.type); + errno = 0; + break; + case TAR_FILETYPE_PAX_GLOBAL: + case TAR_FILETYPE_PAX_EXTENDED: + status = dpkg_put_error(&tar->err, + _("unsupported PAX tar header type '%c'"), + h.type); + errno = 0; + break; default: status = dpkg_put_error(&tar->err, _("unknown tar header type '%c'"), diff --git a/lib/dpkg/tarfn.h b/lib/dpkg/tarfn.h index 06685a720..0302fb8a9 100644 --- a/lib/dpkg/tarfn.h +++ b/lib/dpkg/tarfn.h @@ -54,8 +54,17 @@ enum tar_filetype { TAR_FILETYPE_BLOCKDEV = '4', TAR_FILETYPE_DIR = '5', TAR_FILETYPE_FIFO = '6', + TAR_FILETYPE_CONTIG = '7', TAR_FILETYPE_GNU_LONGLINK = 'K', TAR_FILETYPE_GNU_LONGNAME = 'L', + TAR_FILETYPE_GNU_VOLUME = 'V', + TAR_FILETYPE_GNU_MULTIVOL = 'M', + TAR_FILETYPE_GNU_DUMPDIR = 'D', + TAR_FILETYPE_GNU_SPARSE = 'S', + TAR_FILETYPE_PAX_GLOBAL = 'g', + TAR_FILETYPE_PAX_EXTENDED = 'x', + TAR_FILETYPE_SOLARIS_EXTENDED = 'X', + TAR_FILETYPE_SOLARIS_ACL = 'A', }; struct tar_entry { |