Systemd/src/import
Lennart Poettering e4ec78206c import: make sure gnu tar complains on tar files with trailing garbage
By default GNU tar will only read the first archive if multiple archives
are concatenated and ignore the rest. If an archive contains trailing
garbage this will hence not be recognized by tar as error, it simply
stops reading when the first archive is done (which might escalate to
SIGPIPE when invoked via a pipe).

Let's add --ignore-zeros to the tar command line when extracting. This
means:

1) if a tar archive was concatenated (i.e. generated with tar -A) we'll
   process it correctly.

2) if a tar archive contains trailing garbage tar will now generate an
   error message about it, instead of just throwing EPIPE, which makes
   things easier to debug as broken files are not silently processed.

I think it's OK for gnu tar to ignore trailing garbage when dealing with
classic tapes drives, i.e. mediums that do not have a size limit
built-in. However, this is not what we are dealing with: we are dealing
with OS images here, that hopefully someone generated with a clean build
system, that were signed and validated and hence should not contain
trailing garbage.  Hence it's better to refuse and complain thant to
silently eat up like for classic tape drives.

Fixes: #16605
2020-09-02 08:59:33 +02:00
..
curl-util.c tree-wide: make use of new relative time events in sd-event.h 2020-07-28 11:24:55 +02:00
curl-util.h importd: Avoid need for fd translation table 2019-07-09 10:00:13 +02:00
export-raw.c include missing_fcntl.h where needed 2019-11-07 10:17:44 +00:00
export-raw.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
export-tar.c tree-wide: say "ratelimit" not "rate_limit" 2019-09-20 16:05:53 +02:00
export-tar.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
export.c basic: add new helper call empty_or_dash_to_null() 2019-04-08 12:11:11 +02:00
import-common.c import: make sure gnu tar complains on tar files with trailing garbage 2020-09-02 08:59:33 +02:00
import-common.h import: rerrange tarball/fs imports that have a single top-level directory containing the OS tree 2018-11-26 18:09:01 +01:00
import-compress.c Make bzip2 an optional dependency for systemd-importd 2018-09-25 10:58:09 +02:00
import-compress.h Make bzip2 an optional dependency for systemd-importd 2018-09-25 10:58:09 +02:00
import-fs.c tree-wide: Replace assert() by assert_se() when there is side effect 2020-05-10 09:23:12 +02:00
import-pubring.gpg import: add image verification using gpg 2015-01-21 04:03:54 +01:00
import-raw.c import: don't complain if FS_NOCOW_FL is not available 2020-01-20 21:10:31 +01:00
import-raw.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
import-tar.c import: use our new btrfs_subvol_make_fallback() at two places 2020-04-09 12:13:08 +02:00
import-tar.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
import.c basic: add new helper call empty_or_dash_to_null() 2019-04-08 12:11:11 +02:00
importd.c shared: split out property get helpers 2020-06-30 15:10:17 +02:00
meson.build machine: add support for importing containers from plain directories 2018-11-26 18:09:01 +01:00
org.freedesktop.import1.conf machine: add support for importing containers from plain directories 2018-11-26 18:09:01 +01:00
org.freedesktop.import1.policy meson: drop unnecessary "transformation" of policy files 2018-02-16 13:01:12 +01:00
org.freedesktop.import1.service Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
pull-common.c tree-wide: replace strjoina() with prefix_roota() 2019-06-25 01:31:26 +09:00
pull-common.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
pull-job.c tree-wide: get rid of strappend() 2019-07-12 14:31:12 +09:00
pull-job.h import: drop logic of setting up /var/lib/machines as btrfs loopback mount 2018-11-26 18:09:01 +01:00
pull-raw.c import: Only keep RO copy if ETag header is set 2020-03-23 21:39:59 -07:00
pull-raw.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
pull-tar.c import: use our new btrfs_subvol_make_fallback() at two places 2020-04-09 12:13:08 +02:00
pull-tar.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
pull.c basic: add new helper call empty_or_dash_to_null() 2019-04-08 12:11:11 +02:00
qcow2-util.c tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
qcow2-util.h tree-wide: remove Lennart's copyright lines 2018-06-14 10:20:20 +02:00
test-qcow2.c headers: remove unneeded includes from util.h 2019-03-27 11:53:12 +01:00