From 443cf449eb8482d6dd24fe0215ecaed867050d4e Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Wed, 25 Mar 2026 12:52:26 +0200 Subject: [PATCH] Fix to use `loopback pinentry` for GPG decryption https://forum.virtualmin.com/t/gpg-encryption-in-usermin/136729/19?u=ilia --- webmin/gnupg-lib.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webmin/gnupg-lib.pl b/webmin/gnupg-lib.pl index e399a3a2d..53bef3d85 100755 --- a/webmin/gnupg-lib.pl +++ b/webmin/gnupg-lib.pl @@ -206,7 +206,8 @@ if ($key) { $pflag = "--batch --passphrase-file ". quotemeta(&get_passphrase_file($key)); } -my $cmd = "$gpgpath $pflag --output ".quotemeta($dstfile). +my $cmd = "$gpgpath --pinentry-mode loopback $pflag". + " --output ".quotemeta($dstfile). " --decrypt ".quotemeta($srcfile); my ($fh, $fpid) = &proc::pty_process_exec($cmd); my ($error, $seen_pass, $keyid);