public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: /, lib/portage/dbapi/
Date: Tue,  2 Jan 2024 04:46:16 +0000 (UTC)	[thread overview]
Message-ID: <1704168596.b071a966357a29e8450688a28ca918166b9e4eb0.sam@gentoo> (raw)

commit:     b071a966357a29e8450688a28ca918166b9e4eb0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  2 04:00:02 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan  2 04:09:56 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b071a966

bintree: don't call trust helper unless bindb is writable

Followup to 6ae45739e208b7a9d59e0b6056be72a5791aae04. My qualm there wrt
writable was whether or not doing something which mutated state (and therefore
possibly the package list) would be confusing but that doesn't make much sense
for a few reasons.

Anyway, change the test to be not just for no-pretend, but also whether the
bindb is writable too, as pretend is already a proxy for whether we may
not have privileges (I can imagine someone possibly having bindb privileges
but not /etc/portage/gnupg, so better to just head this off entirely).

Bug: https://bugs.gentoo.org/915842
Bug: https://bugs.gentoo.org/920180
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                         | 3 ++-
 lib/portage/dbapi/bintree.py | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 038a4dbf8c..2ee334f20c 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,8 @@ Release notes take the form of the following optional categories:
 portage-3.0.61 (UNRELEASED)
 --------------
 
-TODO
+Bug fixes:
+* bintree: Don't call trust helper unless bindb is writable (bug #915842, bug #920180).
 
 portage-3.0.60 (2024-01-02)
 --------------

diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index a139e37659..d352b6fc0e 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -1334,7 +1334,7 @@ class binarytree:
             # when binpackages are involved, not only when we refuse unsigned
             # ones. (If the keys have expired we end up refusing signed but
             # technically invalid packages...)
-            if not pretend:
+            if not pretend and self.dbapi.writable:
                 self._run_trust_helper()
             gpkg_only = True
         else:


             reply	other threads:[~2024-01-02  4:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02  4:46 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-09-14  9:33 [gentoo-commits] proj/portage:master commit in: /, lib/portage/dbapi/ Sam James
2024-10-27 23:13 Zac Medico
2023-09-26 20:54 Sam James
2023-04-07  9:52 Sam James
2022-11-30 22:29 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1704168596.b071a966357a29e8450688a28ca918166b9e4eb0.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox