[elbe-devel] [PATCH v4] repomanager: fix key unlock for existing repo

Torben Hohn torben.hohn at linutronix.de
Tue Apr 30 11:39:52 CEST 2019


errm... ok.
i was confused by the use of self.fs.read_file("conf/distributions")

which is somhow did confise with:

with self.fs.open("conf/distributions") as 

so we need splitlines() and self.keyid = l.split()[1]

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

On Tue, Apr 30, 2019 at 10:56:08AM +0200, Torben Hohn wrote:
> From: Manuel Traut <manut at linutronix.de>
> 
> the gnupg key should be unlocked by the repomanager constructor.
> However "elbe prjrepo upload_pkg" fails with the following error:
> 
> --8<--
> running cmd +reprepro --basedir
> "/var/cache/elbe/e9c6c678-669b-4d6c-b822-d432e62a78ea/repo" export jessie+
> ------------------------------------------------------------------------------
> gpgme gave error Pinentry:32870:  Inappropriate ioctl for device
> ERROR: Could not finish exporting 'jessie'!
> There have been errors!
> ------------------------------------------------------------------------------
> Command failed with errorcode 251
> --8<--
> 
> This is because the SignWith line in reprepos distribution configuration
> was not parsed correctly, and keyid containes the trailing newline.
> 
> Fix it by using split() without parameter, which splits the string at all
> whitespace and therefore strips the trailing newline as well.
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>
> [torbenh: use split() instead of using splitlines()]
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
> ---
>  elbepack/repomanager.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/elbepack/repomanager.py b/elbepack/repomanager.py
> index a1b4f500..e9057205 100644
> --- a/elbepack/repomanager.py
> +++ b/elbepack/repomanager.py
> @@ -90,7 +90,7 @@ class RepoBase(object):
>              repo_conf = self.fs.read_file("conf/distributions")
>              for l in repo_conf:

+              for l in repo_conf.splitlines():

>                  if l.startswith("SignWith"):
> -                    self.keyid = l.split(" ")[1]
> +                    self.keyid = l.split()[1]
>                      unlock_key(self.keyid)
>          else:
>              self.keyid = generate_elbe_internal_key()
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20190430/d2d2d6b4/attachment.sig>


More information about the elbe-devel mailing list