1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

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

(cherry picked from commit 181eea677d)
(cherry picked from commit 817b8441c4)
(cherry picked from commit 48f3e2d5c5)
This commit is contained in:
Arsen Arsenović 2023-01-28 22:32:41 +01:00 committed by Luca Boccassi
parent 37d4bf1cd2
commit 5d8283f77d

View File

@ -46,7 +46,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",