]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
importd: Always specify file unpacked by tar
authorArsen Arsenović <arsen@gentoo.org>
Sat, 28 Jan 2023 21:32:41 +0000 (22:32 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 31 Jan 2023 11:21:44 +0000 (12:21 +0100)
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

src/import/import-common.c

index 0e2c7edae1c108487dacdbac7363bd9b5f7f13b2..874d27d2920be4c742460f9c3aae5d621c129627 100644 (file)
@@ -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",