[import] fix stdin/stdout pipe behavior in import/export tar/raw
authorAnita Zhang <the.anitazha@gmail.com>
Tue, 17 Dec 2019 09:08:04 +0000 (01:08 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 5 Feb 2020 16:22:05 +0000 (17:22 +0100)
commitc90229d81da00715a4570f41b7dad582537fc85b
tree16cb3cd747f95a8a53c67caab14abeba3a8cde63
parent39910328da09fd13e4c24aac1369e33a68f288d2
[import] fix stdin/stdout pipe behavior in import/export tar/raw

The code existed in machinectl to use stdin/stdout if the path for
import/export tar/raw was empty or dash (-) but a check to
`fd_verify_regular` in importd prevented it from working.

Update the check instead to explicitly check for regular file or
pipe/fifo.

Fixes #14346

(cherry picked from commit 1209ef94bd09bdc67a7b51f084910a5982f2f010)
(cherry picked from commit cfced59a4bd88e7d77ecf9ed40a22ec215356a83)
src/import/importd.c
test/TEST-25-IMPORT/testsuite.sh