[elbe-devel] [PATCH 2/2] virtapt: do not require /etc/apt/trusted.gpg

Kurt Kanzenbach kurt at linutronix.de
Fri Mar 16 12:06:57 CET 2018


On Fri, Mar 16, 2018 at 11:50:32AM +0100, John Ogness wrote:
> Before elbe adds any keys specified in the xml file, setup_gpg()
> copies /etc/apt/trusted.gpg from the host to use as the elbe apt
> keyring. This was implemented in b78d59f8114f ("virtapt: use
> etc/apt/trusted.gpg instead of etc/apt/trusted.gpg.d"). However,
> trusted.gpg only contains locally added keys and may not exist.
>
> Only copy trusted.gpg from the host if it actually exists. If it
> does not exist, setup_gpg() will create an empty keyring for use
> elbe to use.
>
> Signed-off-by: John Ogness <john.ogness at linutronix.de>

Reviewed-by: Kurt Kanzenbach <kurt at linutronix.de>

> ---
>  elbepack/virtapt.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
> index 6bdadc4b..295d4e36 100644
> --- a/elbepack/virtapt.py
> +++ b/elbepack/virtapt.py
> @@ -162,7 +162,8 @@ class VirtApt:
>                    "fix this problem")
>              sys.exit(20)
>
> -        system('cp /etc/apt/trusted.gpg "%s"' % ring_path)
> +        if os.path.exists("/etc/apt/trusted.gpg"):
> +            system('cp /etc/apt/trusted.gpg "%s"' % ring_path)
>
>          gpg_options = '--keyring "%s" --no-auto-check-trustdb ' \
>                        '--trust-model always --no-default-keyring ' \
> --
> 2.11.0
>
>
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel



More information about the elbe-devel mailing list