summaryrefslogtreecommitdiff
path: root/src/import
diff options
context:
space:
mode:
authorArsen Arsenović <arsen@gentoo.org>2023-01-28 22:32:41 +0100
committerLennart Poettering <lennart@poettering.net>2023-01-31 12:21:44 +0100
commit181eea677dd364d2b22dc691647792142b271074 (patch)
tree7d3469b886964f9aa61913545b3615fe9b5a0ddd /src/import
parenta4440918401240533a68afd3adebe5f125e1cf18 (diff)
downloadsystemd-181eea677dd364d2b22dc691647792142b271074.tar.gz
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
Diffstat (limited to 'src/import')
-rw-r--r--src/import/import-common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/import/import-common.c b/src/import/import-common.c
index 0e2c7edae1..874d27d292 100644
--- a/src/import/import-common.c
+++ b/src/import/import-common.c
@@ -45,7 +45,8 @@ int import_fork_tar_x(const char *path, pid_t *ret) {
"--ignore-zeros",
"--numeric-owner",
"-C", path,
- "-px",
+ "-pxf",
+ "-",
"--xattrs",
"--xattrs-include=*",
use_selinux ? "--selinux" : "--no-selinux",