https://bugs.kde.org/show_bug.cgi?id=369274

            Bug ID: 369274
           Summary: "expert" button on key generation dialog doesn't bring
                    up Konsole
           Product: kgpg
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: k...@opensource.sf-tec.de
          Reporter: ste...@uplinklabs.net

The arguments KGPG is using aren't quoted properly. It passes an argument list
like this:

[ "konsole", "-e", "gpg", "--gen-key", "--expert" ]

instead of this:

[ "konsole", "-e", "gpg --gen-key --expert" ]

Reproducible: Always




This fixes it, and also uses --full-gen-key instead of --gen-key on GPG 2.1+.
If we're going "expert" we might as well go all the way.

diff --git a/keysmanager.cpp b/keysmanager.cpp
index d0073da..8604063 100644
--- a/keysmanager.cpp
+++ b/keysmanager.cpp
@@ -507,11 +507,17 @@ void KeysManager::slotGenerateKey()
                        KConfigGroup config(KGlobal::config(), "General");

                        QString
terminalApp(config.readPathEntry("TerminalApplication", QLatin1String(
"konsole" )));
+
+                       QString gpg_args;
+                       gpg_args += KGpgSettings::gpgBinaryPath() +
QLatin1String(" --expert");
+                       if
(GPGProc::gpgVersion(GPGProc::gpgVersionString(QString())) > 0x20100)
+                               gpg_args += QLatin1String(" --full-gen-key");
+                       else
+                               gpg_args += QLatin1String(" --gen-key");
+
                        QStringList args;
                        args << QLatin1String( "-e" )
-                              << KGpgSettings::gpgBinaryPath()
-                                       + QLatin1String(" --full-gen-key")
-                                       + QLatin1String(" --expert");
+                            << gpg_args;

                        QProcess *genKeyProc = new QProcess(this);
                        genKeyProc->start(terminalApp, args);

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to