Fix to use loopback pinentry for GPG decryption

https://forum.virtualmin.com/t/gpg-encryption-in-usermin/136729/19?u=ilia
This commit is contained in:
Ilia Ross
2026-03-25 12:52:26 +02:00
parent 58d6308589
commit 443cf449eb

View File

@@ -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);