From 6883d3543aca94e4a3cbc829ec80abc679ad9d2c Mon Sep 17 00:00:00 2001 From: zhaoxiaohu Date: Thu, 29 Aug 2024 15:23:16 +0800 Subject: [PATCH] importd: Always specify file unpacked by tar Signed-off-by: zhaoxiaohu --- ...-Always-specify-file-unpacked-by-tar.patch | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 backport-importd-Always-specify-file-unpacked-by-tar.patch diff --git a/backport-importd-Always-specify-file-unpacked-by-tar.patch b/backport-importd-Always-specify-file-unpacked-by-tar.patch new file mode 100644 index 0000000..1af5e03 --- /dev/null +++ b/backport-importd-Always-specify-file-unpacked-by-tar.patch @@ -0,0 +1,42 @@ +From 3a609cf64f74f78697ef1ad05d85f9c0ef07f87c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= +Date: Sat, 28 Jan 2023 22:32:41 +0100 +Subject: [PATCH] importd: Always specify file unpacked by tar + +Despite popular belief, the default file extracted by GNU tar is not stdin. It +is the value of the TAPE environment variable, falling back on a compile-time +constant. On my system, the default value is /dev/full, which causes tar to +just spin forever due to --ignore-zeros. Always specifying this flag is the +safe thing to do. + + ~$ tar --show-defaults + --format=gnu -f/dev/full -b20 --quoting-style=escape + --rmt-command=/usr/sbin/grmt + +See also: ``(tar)defaults'', available via Info viewers, and in HTML form at: +https://www.gnu.org/s/tar/manual/html_node/defaults.html + +Reference: https://github.com/systemd/systemd/pull/26243/commits/f28d94106d6ed01420079f1034e332193c12d6dd + +Signed-off-by: zhaoxiaohu +Signed-off-by: yuwang +--- + src/import/import-common.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/import/import-common.c b/src/import/import-common.c +index f77564c..70a0a73 100644 +--- a/src/import/import-common.c ++++ b/src/import/import-common.c +@@ -97,6 +97,8 @@ int import_fork_tar_x(const char *path, pid_t *ret) { + "--numeric-owner", + "-C", path, + "-px", ++ "-pxf", ++ "-", + "--xattrs", + "--xattrs-include=*", + use_selinux ? "--selinux" : "--no-selinux", +-- +2.33.0 +