Bug 428215

Summary: Expert mode key generation only works if using default GnuPG home
Product: [Applications] kgpg Reporter: Fredrick Brennan <copypaste>
Component: generalAssignee: Rolf Eike Beer <kde>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 20.08   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshots.

Description Fredrick Brennan 2020-10-25 08:58:04 UTC
Created attachment 132710 [details]
Screenshots.

SUMMARY

Expert mode KGpg key generation only works if the user is using the default GnuPG home. This is common for some users who juggle multiple keychains, which there are a variety of good reasons for doing.

STEPS TO REPRODUCE
1. Outside KGpg, create a GnuPG home dir. E.g., run at minimum:

  $ mkdir -m 0700 ~/.gnupg-kde_bug_report
  $ gpg2 --homedir=!$ --list-keys
  gpg2 --homedir=~/.gnupg-kde_bug_report --list-keys
  gpg: keybox '/home/fred/.gnupg-kde_bug_report/pubring.kbx' created
  gpg: /home/fred/.gnupg-kde_bug_report/trustdb.gpg: trustdb created
  $ touch ~/.gnupg-kde_bug_report/gpg.conf

2. Inside KGpg, go to «Settings→GnuPG Settings». Set the home location to ~/.gnupg-kde_bug_report using the GUI.
3. «Keys→Generate Keypair…». Observe it works if not clicked «Expert Mode». (bugzip/working example.png)
4. «Keys→Generate Keypair…». Observe breakage as soon as clicked «Expert Mode». (bugzip/broken example.png)

OBSERVED RESULT

Terminal opens and fails to launch child gpg2.

EXPECTED RESULT

Successful launch of gpg2.


SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma: 5.20.1
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Comment 1 Rolf Eike Beer 2020-10-25 11:17:37 UTC
Git commit 565b6c3173745019539278d3bb9c05e524b776c3 by Rolf Eike Beer.
Committed on 25/10/2020 at 10:56.
Pushed by dakon into branch 'master'.

use the configured config file and directory when generating keys in expert mode

M  +22   -13   gpgproc.cpp
M  +7    -0    gpgproc.h
M  +2    -0    keysmanager.cpp

https://invent.kde.org/utilities/kgpg/commit/565b6c3173745019539278d3bb9c05e524b776c3