Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 644906

Summary: app-crypt/gkeys-0.2: Seeds.load method wrongly opens seedfile in write mode
Product: Gentoo Linux Reporter: Zac Medico <zmedico>
Component: Current packagesAssignee: Gentoo-keys project <gkeys>
Status: RESOLVED OBSOLETE    
Severity: normal CC: treecleaner
Priority: Normal Keywords: PATCH, PMASKED
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Deadline: 2020-05-19   

Description Zac Medico gentoo-dev 2018-01-18 04:28:46 UTC
This issue prevents `gkeys list-key -C gentoo --keydir release -n snapshot` from working for non-root users. This patch fixes it:

diff --git a/gkeys/gkeys/seed.py b/gkeys/gkeys/seed.py
index 96bd8b2..7d17643 100644
--- a/gkeys/gkeys/seed.py
+++ b/gkeys/gkeys/seed.py
@@ -68,5 +68,5 @@ class Seeds(object):
         self.seeds = {}
         try:
-            with open(self.filename, "r+") as seedfile:
+            with open(self.filename, "r") as seedfile:
                 seedlines = json.load(seedfile)
         except IOError as err:
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-04-19 12:12:25 UTC
app-crypt/gkeys is last rited now.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-05-23 09:31:21 UTC
Removing.