aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ammerlaan <andrewammerlaan@gentoo.org>2023-08-23 13:47:32 +0200
committerMike Gilbert <floppym@gentoo.org>2023-08-24 14:23:41 -0400
commit9d278330839049a818ba9f1e3985c7e502c63451 (patch)
tree207003a1071cc8e4b04437000560cae75c4db8a3
parentemerge-webrsync: Avoid double slash when expanding EPREFIX (diff)
downloadportage-9d278330.tar.gz
portage-9d278330.tar.bz2
portage-9d278330.zip
lib/portage/gpg.py: send gpg output to stdout, then send stdout to /dev/null
GnuPG removes the --output file on failure. Removing /dev/null breaks all kinds of things. Instead of telling GnuPG to output to /dev/null we output to stdout and then send the stdout to /dev/null, this avoids the problem where /dev/null is removed when the key fails to unlock. Bug: https://bugs.gentoo.org/912808 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rw-r--r--lib/portage/gpg.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/portage/gpg.py b/lib/portage/gpg.py
index 6238ea6f7..306787224 100644
--- a/lib/portage/gpg.py
+++ b/lib/portage/gpg.py
@@ -35,7 +35,7 @@ class GPG:
f"--homedir {self.signing_gpg_home} "
f"--digest-algo {self.digest_algo} "
f"--local-user {self.signing_gpg_key} "
- "--output /dev/null /dev/null",
+ "--output - /dev/null",
)
if "gpg-keepalive" in self.settings.features:
@@ -61,7 +61,7 @@ class GPG:
writemsg(f"{colorize('WARN', str(e))}\n")
cmd = shlex_split(varexpand(self.GPG_unlock_command, mydict=self.settings))
- return_code = subprocess.Popen(cmd).wait()
+ return_code = subprocess.Popen(cmd, stdout=subprocess.DEVNULL).wait()
if return_code == os.EX_OK:
writemsg_stdout(f"{colorize('GOOD', 'unlocked')}\n")