feature(keyringctl): support importing from a piped fd

This feature allows to import from a piped fd like:
> ./keyringctl import --name foobar <(gpg --export foo@bar)

We achieve this even with hidepid by taking the naive approach of
copying the processes fd source to a tempfile and pass around latter.
This commit is contained in:
Levente Polyak
2021-10-26 19:24:30 +02:00
parent 2384d0337b
commit 26c7027660
3 changed files with 29 additions and 6 deletions

View File

@ -140,7 +140,7 @@ def main() -> None: # noqa: ignore=C901
convert(
working_dir=working_dir,
keyring_root=keyring_root,
source=args.source,
sources=args.source,
target_dir=target_dir,
name_override=args.name,
)
@ -151,7 +151,7 @@ def main() -> None: # noqa: ignore=C901
convert(
working_dir=working_dir,
keyring_root=keyring_root,
source=args.source,
sources=args.source,
target_dir=keyring_root / target_dir,
name_override=args.name,
)