[kde-plasma-networkmanagement/f18] backport upstream vpn-related fixes (#882308)

Rex Dieter rdieter at fedoraproject.org
Thu Dec 6 17:31:42 UTC 2012


commit db8db28bdb749e189a39e922e24632d155ec093a
Author: Rex Dieter <rdieter at math.unl.edu>
Date:   Thu Dec 6 11:31:49 2012 -0600

    backport upstream vpn-related fixes (#882308)

 ...-about-things-that-must-not-go-to-the-log.patch |   27 +++
 ...crets-in-password-dialog-for-wifi-connect.patch |  223 ++++++++++++++++++++
 ...Condtion-wakeAll-call-with-mutex-lock-unl.patch |   28 +++
 ...cf-files-can-have-string-keys-either-as-k.patch |  169 +++++++++++++++
 0016-Text-formatting.patch                         |   45 ++++
 0022-Use-correct-default-password-mode.patch       |   86 ++++++++
 ...error-message-if-loading-vpn-plugin-fails.patch |   25 +++
 ...ionSecretsJob-doAskUser-for-vpn-connectio.patch |   26 +++
 kde-plasma-networkmanagement.spec                  |   23 ++-
 9 files changed, 650 insertions(+), 2 deletions(-)
---
diff --git a/0002-Add-warning-about-things-that-must-not-go-to-the-log.patch b/0002-Add-warning-about-things-that-must-not-go-to-the-log.patch
new file mode 100644
index 0000000..cdb64c7
--- /dev/null
+++ b/0002-Add-warning-about-things-that-must-not-go-to-the-log.patch
@@ -0,0 +1,27 @@
+From 045b4acb07960c1e80a00ec91f0fbd486a50c84c Mon Sep 17 00:00:00 2001
+From: "Lamarque V. Souza" <lamarque at kde.org>
+Date: Fri, 5 Oct 2012 15:44:40 -0300
+Subject: [PATCH 02/26] Add warning about things that must not go to the log
+ file. (cherry picked from commit 8bb1990ff05ee9cd1ac0efd476b7b7d0aa195f46)
+
+---
+ backends/NetworkManager/nmdbussecretagent.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/backends/NetworkManager/nmdbussecretagent.cpp b/backends/NetworkManager/nmdbussecretagent.cpp
+index b911748..1b11a81 100644
+--- a/backends/NetworkManager/nmdbussecretagent.cpp
++++ b/backends/NetworkManager/nmdbussecretagent.cpp
+@@ -86,7 +86,8 @@ void NMDBusSecretAgent::registerAgent()
+ QVariantMapMap NMDBusSecretAgent::GetSecrets(const QVariantMapMap &connection, const QDBusObjectPath &connection_path, const QString &setting_name, const QStringList &hints, uint flags)
+ {
+     Q_D(NMDBusSecretAgent);
+-    kDebug() << connection;
++    // WARNING: do not commit this uncommented.
++    //kDebug() << connection;
+     kDebug() << setting_name << flags << hints;
+ 
+     QDBusMessage msg = message();
+-- 
+1.8.0.1
+
diff --git a/0004-Pre-fill-secrets-in-password-dialog-for-wifi-connect.patch b/0004-Pre-fill-secrets-in-password-dialog-for-wifi-connect.patch
new file mode 100644
index 0000000..f33c511
--- /dev/null
+++ b/0004-Pre-fill-secrets-in-password-dialog-for-wifi-connect.patch
@@ -0,0 +1,223 @@
+From 27e81bf922022c309eb39f1a3c413f2174ebb12a Mon Sep 17 00:00:00 2001
+From: "Lamarque V. Souza" <lamarque at kde.org>
+Date: Fri, 5 Oct 2012 16:44:50 -0300
+Subject: [PATCH 04/26] Pre-fill secrets in password dialog for wifi
+ connections.
+
+---
+ backends/NetworkManager/nmdbussecretagent.cpp      |  2 +-
+ .../settings/802-11-wireless-security.cpp          | 33 +++++++++++++++++-----
+ libs/ui/security/leapauthwidget.cpp                |  5 ++++
+ libs/ui/security/leapauthwidget.h                  |  2 +-
+ libs/ui/security/wepauthwidget.cpp                 | 18 ++++++++++++
+ libs/ui/security/wepauthwidget.h                   |  2 +-
+ libs/ui/security/wirelesssecurityauth.cpp          |  7 +++++
+ libs/ui/security/wirelesssecurityauth.h            |  3 +-
+ libs/ui/security/wpaauthwidget.cpp                 |  5 ++++
+ libs/ui/security/wpaauthwidget.h                   |  2 +-
+ 11 files changed, 68 insertions(+), 13 deletions(-)
+
+diff --git a/backends/NetworkManager/nmdbussecretagent.cpp b/backends/NetworkManager/nmdbussecretagent.cpp
+index 1b11a81..f802604 100644
+--- a/backends/NetworkManager/nmdbussecretagent.cpp
++++ b/backends/NetworkManager/nmdbussecretagent.cpp
+@@ -94,7 +94,7 @@ QVariantMapMap NMDBusSecretAgent::GetSecrets(const QVariantMapMap &connection, c
+     msg.setDelayedReply(true);
+     Knm::Connection * con = new Knm::Connection(QUuid(), Knm::Connection::Wired);
+     ConnectionDbus condbus(con);
+-    condbus.fromDbusMap(connection);
++    condbus.fromDbusSecretsMap(connection);
+     QPair<QString,QDBusMessage> pair;
+     pair.first = connection_path.path();
+     pair.second = msg;
+diff --git a/libs/internals/settings/802-11-wireless-security.cpp b/libs/internals/settings/802-11-wireless-security.cpp
+index 7bb4167..613ff32 100644
+--- a/libs/internals/settings/802-11-wireless-security.cpp
++++ b/libs/internals/settings/802-11-wireless-security.cpp
+@@ -83,13 +83,32 @@ QMap<QString,QString> WirelessSecuritySetting::secretsToMap() const
+ 
+ void WirelessSecuritySetting::secretsFromMap(QMap<QString,QString> secrets)
+ {
+-    setWepkey0(secrets.value("wepkey0"));
+-    setWepkey1(secrets.value("wepkey1"));
+-    setWepkey2(secrets.value("wepkey2"));
+-    setWepkey3(secrets.value("wepkey3"));
+-    setPsk(secrets.value("psk"));
+-    setLeappassword(secrets.value("leappassword"));
+-    setSecretsAvailable(true);
++    bool secretsAvailable = false;
++    if (secrets.contains("wepkey0")) {
++        setWepkey0(secrets.value("wepkey0"));
++        secretsAvailable = true;
++    }
++    if (secrets.contains("wepkey1")) {
++        setWepkey1(secrets.value("wepkey1"));
++        secretsAvailable = true;
++    }
++    if (secrets.contains("wepkey2")) {
++        setWepkey2(secrets.value("wepkey2"));
++        secretsAvailable = true;
++    }
++    if (secrets.contains("wepkey3")) {
++        setWepkey3(secrets.value("wepkey3"));
++        secretsAvailable = true;
++    }
++    if (secrets.contains("psk")) {
++        setPsk(secrets.value("psk"));
++        secretsAvailable = true;
++    }
++    if (secrets.contains("leappassword")) {
++        setLeappassword(secrets.value("leappassword"));
++        secretsAvailable = true;
++    }
++    setSecretsAvailable(secretsAvailable);
+ }
+ 
+ QStringList WirelessSecuritySetting::needSecrets() const
+diff --git a/libs/ui/security/leapauthwidget.cpp b/libs/ui/security/leapauthwidget.cpp
+index c5fd896..79d589f 100644
+--- a/libs/ui/security/leapauthwidget.cpp
++++ b/libs/ui/security/leapauthwidget.cpp
+@@ -74,6 +74,11 @@ bool LeapAuthWidget::validate() const
+     return true;
+ }
+ 
++void LeapAuthWidget::readSecrets()
++{
++    d->pw->setText(d->setting->leappassword());
++}
++
+ void LeapAuthWidget::writeConfig()
+ {
+     d->setting->setLeappassword(d->pw->text());
+diff --git a/libs/ui/security/leapauthwidget.h b/libs/ui/security/leapauthwidget.h
+index 3c01e1d..d5418ae 100644
+--- a/libs/ui/security/leapauthwidget.h
++++ b/libs/ui/security/leapauthwidget.h
+@@ -39,7 +39,7 @@ public:
+     bool validate() const;
+     void readConfig() {}
+     void writeConfig();
+-    void readSecrets() {}
++    void readSecrets();
+ public Q_SLOTS:
+     virtual void setShowPasswords(bool);
+ private:
+diff --git a/libs/ui/security/wepauthwidget.cpp b/libs/ui/security/wepauthwidget.cpp
+index 0de351f..bc4dbeb 100644
+--- a/libs/ui/security/wepauthwidget.cpp
++++ b/libs/ui/security/wepauthwidget.cpp
+@@ -109,6 +109,24 @@ void WepAuthWidget::readConfig()
+     connect(d->pw, SIGNAL(textChanged(QString)), SLOT(validateKey(QString)));
+ }
+ 
++void WepAuthWidget::readSecrets()
++{
++    switch (d->setting->weptxkeyindex()) {
++        case 0:
++            d->pw->setText(d->setting->wepkey0());
++            break;
++        case 1:
++            d->pw->setText(d->setting->wepkey1());
++            break;
++        case 2:
++            d->pw->setText(d->setting->wepkey2());
++            break;
++        case 3:
++            d->pw->setText(d->setting->wepkey3());
++            break;
++    }
++}
++
+ void WepAuthWidget::writeConfig()
+ {
+     switch (d->setting->weptxkeyindex()) {
+diff --git a/libs/ui/security/wepauthwidget.h b/libs/ui/security/wepauthwidget.h
+index c225d69..ff692e3 100644
+--- a/libs/ui/security/wepauthwidget.h
++++ b/libs/ui/security/wepauthwidget.h
+@@ -39,7 +39,7 @@ public:
+     bool validate() const;
+     void readConfig();
+     void writeConfig();
+-    void readSecrets() {}
++    void readSecrets();
+ public Q_SLOTS:
+     virtual void setShowPasswords(bool);
+     void validateKey(const QString&);
+diff --git a/libs/ui/security/wirelesssecurityauth.cpp b/libs/ui/security/wirelesssecurityauth.cpp
+index 91e4c74..0333fa1 100644
+--- a/libs/ui/security/wirelesssecurityauth.cpp
++++ b/libs/ui/security/wirelesssecurityauth.cpp
+@@ -1,5 +1,6 @@
+ /*
+ Copyright 2011 Ilia Kats <ilia-kats at gmx.net>
++Copyright 2012 Lamarque V. Souza <lamarque at kde.org>
+ 
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+@@ -113,6 +114,12 @@ void WirelessSecurityAuthWidget::readConfig()
+     connect(showPasswords, SIGNAL(toggled(bool)), d->settingWidget, SLOT(setShowPasswords(bool)));
+ }
+ 
++void WirelessSecurityAuthWidget::readSecrets()
++{
++    Q_D(WirelessSecurityAuthWidget);
++    d->settingWidget->readSecrets();
++}
++
+ void WirelessSecurityAuthWidget::writeConfig()
+ {
+     Q_D(WirelessSecurityAuthWidget);
+diff --git a/libs/ui/security/wirelesssecurityauth.h b/libs/ui/security/wirelesssecurityauth.h
+index 25787a4..f07ee47 100644
+--- a/libs/ui/security/wirelesssecurityauth.h
++++ b/libs/ui/security/wirelesssecurityauth.h
+@@ -1,5 +1,6 @@
+ /*
+ Copyright 2011 Ilia Kats <ilia-kats at gmx.net>
++Copyright 2012 Lamarque V. Souza <lamarque at kde.org>
+ 
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+@@ -39,7 +40,7 @@ public:
+     virtual ~WirelessSecurityAuthWidget();
+     void readConfig();
+     void writeConfig();
+-    void readSecrets() {}
++    void readSecrets();
+ protected Q_SLOTS:
+     void validate();
+ };
+diff --git a/libs/ui/security/wpaauthwidget.cpp b/libs/ui/security/wpaauthwidget.cpp
+index d48b406..642ba3e 100644
+--- a/libs/ui/security/wpaauthwidget.cpp
++++ b/libs/ui/security/wpaauthwidget.cpp
+@@ -74,6 +74,11 @@ bool WpaAuthWidget::validate() const
+     return true;
+ }
+ 
++void WpaAuthWidget::readSecrets()
++{
++    d->pw->setText(d->setting->psk());
++}
++
+ void WpaAuthWidget::writeConfig()
+ {
+     d->setting->setPsk(d->pw->text());
+diff --git a/libs/ui/security/wpaauthwidget.h b/libs/ui/security/wpaauthwidget.h
+index 91e7495..a84812b 100644
+--- a/libs/ui/security/wpaauthwidget.h
++++ b/libs/ui/security/wpaauthwidget.h
+@@ -39,7 +39,7 @@ public:
+     bool validate() const;
+     void readConfig() {}
+     void writeConfig();
+-    void readSecrets() {}
++    void readSecrets();
+ public Q_SLOTS:
+     virtual void setShowPasswords(bool);
+ private:
+-- 
+1.8.0.1
+
diff --git a/0014-guard-QWaitCondtion-wakeAll-call-with-mutex-lock-unl.patch b/0014-guard-QWaitCondtion-wakeAll-call-with-mutex-lock-unl.patch
new file mode 100644
index 0000000..e76178f
--- /dev/null
+++ b/0014-guard-QWaitCondtion-wakeAll-call-with-mutex-lock-unl.patch
@@ -0,0 +1,28 @@
+From 0099e4313d7545edc450de4408958869819fd5fb Mon Sep 17 00:00:00 2001
+From: Ilia Kats <ilia-kats at gmx.net>
+Date: Mon, 29 Oct 2012 21:23:06 +0100
+Subject: [PATCH 14/26] guard QWaitCondtion::wakeAll() call with mutex
+ lock/unlock to prevent deadlock
+
+BUG: 308630
+---
+ vpnplugins/openconnect/openconnectauth.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/vpnplugins/openconnect/openconnectauth.cpp b/vpnplugins/openconnect/openconnectauth.cpp
+index 93eb404..e291c6e 100644
+--- a/vpnplugins/openconnect/openconnectauth.cpp
++++ b/vpnplugins/openconnect/openconnectauth.cpp
+@@ -513,7 +513,9 @@ void OpenconnectAuthWidget::validatePeerCert(const QString &fingerprint,
+     } else {
+         *accepted = true;
+     }
++    d->mutex.lock();
+     d->workerWaiting.wakeAll();
++    d->mutex.unlock();
+ }
+ 
+ // Writes the user input from the form into the oc_auth_form structs we got from
+-- 
+1.8.0.1
+
diff --git a/0015-CISCO-vpn-pcf-files-can-have-string-keys-either-as-k.patch b/0015-CISCO-vpn-pcf-files-can-have-string-keys-either-as-k.patch
new file mode 100644
index 0000000..f52e49d
--- /dev/null
+++ b/0015-CISCO-vpn-pcf-files-can-have-string-keys-either-as-k.patch
@@ -0,0 +1,169 @@
+From 63b90e694694cbd2056c76779a4ce12b6cf5b615 Mon Sep 17 00:00:00 2001
+From: Rajeesh K Nambiar <rajeeshknambiar at gmail.com>
+Date: Wed, 31 Oct 2012 06:11:43 -0200
+Subject: [PATCH 15/26] CISCO vpn pcf files can have string keys either as
+ "<key>" or "!<key>". If <key> is not found, look for !<key> too.
+
+BUG: 309262
+FIXED-IN: 0.9.0.6
+---
+ vpnplugins/vpnc/vpnc.cpp | 51 ++++++++++++++++++++++++++++++------------------
+ vpnplugins/vpnc/vpnc.h   |  4 +++-
+ 3 files changed, 36 insertions(+), 21 deletions(-)
+
+diff --git a/vpnplugins/vpnc/vpnc.cpp b/vpnplugins/vpnc/vpnc.cpp
+index 381528e..dbe6749 100644
+--- a/vpnplugins/vpnc/vpnc.cpp
++++ b/vpnplugins/vpnc/vpnc.cpp
+@@ -1,6 +1,7 @@
+ /*
+ Copyright 2008 Will Stephenson <wstephenson at kde.org>
+ Copyright 2011-2012 Rajeesh K Nambiar <rajeeshknambiar at gmail.com>
++Copyright 2011-2012 Lamarque V. Souza <lamarque at kde.org>
+ 
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+@@ -47,6 +48,17 @@ VpncUiPluginPrivate::~VpncUiPluginPrivate()
+ {
+ }
+ 
++QString VpncUiPluginPrivate::readStringKeyValue(const KConfigGroup & configGroup, const QString & key)
++{
++    QString retValue = configGroup.readEntry(key);
++    if (retValue.isEmpty()) {
++        // String key can also start with "!" in CISCO pcf file.
++        return configGroup.readEntry("!" + key);
++    } else {
++        return retValue;
++    }
++}
++
+ void VpncUiPluginPrivate::gotciscoDecryptOutput()
+ {
+     QByteArray output = ciscoDecrypt->readAll();
+@@ -150,17 +162,17 @@ QVariantList VpncUiPlugin::importConnectionSettings(const QString &fileName)
+         QStringMap ipv4Data;
+ 
+         // gateway
+-        data.insert(NM_VPNC_KEY_GATEWAY, cg.readEntry("Host"));
++        data.insert(NM_VPNC_KEY_GATEWAY, decrPlugin->readStringKeyValue(cg,"Host"));
+         // group name
+-        data.insert(NM_VPNC_KEY_ID, cg.readEntry("GroupName"));
++        data.insert(NM_VPNC_KEY_ID, decrPlugin->readStringKeyValue(cg,"GroupName"));
+         // user password
+-        if (!cg.readEntry("UserPassword").isEmpty()) {
+-            secretData.insert(NM_VPNC_KEY_XAUTH_PASSWORD, cg.readEntry("UserPassword"));
++        if (!decrPlugin->readStringKeyValue(cg,"UserPassword").isEmpty()) {
++            secretData.insert(NM_VPNC_KEY_XAUTH_PASSWORD, decrPlugin->readStringKeyValue(cg,"UserPassword"));
+         }
+-        else if (!cg.readEntry("enc_UserPassword").isEmpty() && !ciscoDecryptBinary.isEmpty()) {
++        else if (!decrPlugin->readStringKeyValue(cg,"enc_UserPassword").isEmpty() && !ciscoDecryptBinary.isEmpty()) {
+             // Decrypt the password and insert into map
+             decrArgs.clear();
+-            decrArgs << cg.readEntry("enc_UserPassword");
++            decrArgs << decrPlugin->readStringKeyValue(cg,"enc_UserPassword");
+             decrPlugin->ciscoDecrypt->setProgram(ciscoDecryptBinary, decrArgs);
+             decrPlugin->ciscoDecrypt->start();
+             if (decrPlugin->ciscoDecrypt->waitForStarted() && decrPlugin->ciscoDecrypt->waitForFinished()) {
+@@ -182,14 +194,14 @@ QVariantList VpncUiPlugin::importConnectionSettings(const QString &fileName)
+         }
+ 
+         // group password
+-        if (!cg.readEntry("GroupPwd").isEmpty()) {
+-            secretData.insert(NM_VPNC_KEY_SECRET, cg.readEntry("GroupPwd"));
++        if (!decrPlugin->readStringKeyValue(cg,"GroupPwd").isEmpty()) {
++            secretData.insert(NM_VPNC_KEY_SECRET, decrPlugin->readStringKeyValue(cg,"GroupPwd"));
+             data.insert(NM_VPNC_KEY_SECRET"-flags", QString::number(Knm::Setting::AgentOwned));
+         }
+-        else if (!cg.readEntry("enc_GroupPwd").isEmpty() && !ciscoDecryptBinary.isEmpty()) {
++        else if (!decrPlugin->readStringKeyValue(cg,"enc_GroupPwd").isEmpty() && !ciscoDecryptBinary.isEmpty()) {
+             //Decrypt the password and insert into map
+             decrArgs.clear();
+-            decrArgs << cg.readEntry("enc_GroupPwd");
++            decrArgs << decrPlugin->readStringKeyValue(cg,"enc_GroupPwd");
+             decrPlugin->ciscoDecrypt->setProgram(ciscoDecryptBinary, decrArgs);
+             decrPlugin->ciscoDecrypt->start();
+             if (decrPlugin->ciscoDecrypt->waitForStarted() && decrPlugin->ciscoDecrypt->waitForFinished()) {
+@@ -197,7 +209,6 @@ QVariantList VpncUiPlugin::importConnectionSettings(const QString &fileName)
+                 data.insert(NM_VPNC_KEY_SECRET"-flags", QString::number(Knm::Setting::AgentOwned));
+             }
+         }
+-        delete decrPlugin;
+ 
+         // Auth Type
+         if (!cg.readEntry("AuthType").isEmpty() && cg.readEntry("AuthType").toInt() == 5) {
+@@ -206,12 +217,12 @@ QVariantList VpncUiPlugin::importConnectionSettings(const QString &fileName)
+ 
+         // Optional settings
+         // username
+-        if (!cg.readEntry("Username").isEmpty()) {
+-            data.insert(NM_VPNC_KEY_XAUTH_USER, cg.readEntry("Username"));
++        if (!decrPlugin->readStringKeyValue(cg,"Username").isEmpty()) {
++            data.insert(NM_VPNC_KEY_XAUTH_USER, decrPlugin->readStringKeyValue(cg,"Username"));
+         }
+         // domain
+-        if (!cg.readEntry("NTDomain").isEmpty()) {
+-            data.insert(NM_VPNC_KEY_DOMAIN, cg.readEntry("NTDomain"));
++        if (!decrPlugin->readStringKeyValue(cg,"NTDomain").isEmpty()) {
++            data.insert(NM_VPNC_KEY_DOMAIN, decrPlugin->readStringKeyValue(cg,"NTDomain"));
+         }
+         // encryption
+         if (!cg.readEntry("SingleDES").isEmpty() && cg.readEntry("SingleDES").toInt() != 0) {
+@@ -247,7 +258,7 @@ QVariantList VpncUiPlugin::importConnectionSettings(const QString &fileName)
+             data.insert(NM_VPNC_KEY_LOCAL_PORT, QString(NM_VPNC_LOCAL_PORT_DEFAULT));
+         }
+         // DH Group
+-        data.insert(NM_VPNC_KEY_DHGROUP, cg.readEntry("DHGroup"));
++        data.insert(NM_VPNC_KEY_DHGROUP, decrPlugin->readStringKeyValue(cg,"DHGroup"));
+         // Tunneling Mode - not supported by vpnc
+         if (cg.readEntry("TunnelingMode").toInt() == 1) {
+             KMessageBox::error(0, i18n("The VPN settings file '%1' specifies that VPN traffic should be tunneled through TCP which is currently not supported in the vpnc software.\n\nThe connection can still be created, with TCP tunneling disabled, however it may not work as expected.").arg(fileName), i18n("Not supported"), KMessageBox::Notify);
+@@ -257,8 +268,8 @@ QVariantList VpncUiPlugin::importConnectionSettings(const QString &fileName)
+         if (!cg.readEntry("EnableLocalLAN").isEmpty()) {
+             ipv4Data.insert(NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, cg.readEntry("EnableLocalLAN"));
+         }
+-        if (!cg.readEntry("X-NM-Routes").isEmpty()) {
+-            ipv4Data.insert(NM_SETTING_IP4_CONFIG_ROUTES, cg.readEntry("X-NM-Routes"));
++        if (!decrPlugin->readStringKeyValue(cg,"X-NM-Routes").isEmpty()) {
++            ipv4Data.insert(NM_SETTING_IP4_CONFIG_ROUTES, decrPlugin->readStringKeyValue(cg,"X-NM-Routes"));
+         }
+ 
+         // Set the '...-type' and '...-flags' value also
+@@ -270,10 +281,12 @@ QVariantList VpncUiPlugin::importConnectionSettings(const QString &fileName)
+ 
+         conSetting << Knm::VpnSetting::variantMapFromStringList(Knm::VpnSetting::stringMapToStringList(data));
+         conSetting << Knm::VpnSetting::variantMapFromStringList(Knm::VpnSetting::stringMapToStringList(secretData));
+-        conSetting << cg.readEntry("Description");
++        conSetting << decrPlugin->readStringKeyValue(cg,"Description");
+         if (!ipv4Data.isEmpty()) {
+             conSetting << Knm::VpnSetting::variantMapFromStringList(Knm::VpnSetting::stringMapToStringList(ipv4Data));
+         }
++
++        delete decrPlugin;
+     } else {
+         mErrorMessage = i18n("%1: file format error.", fileName);
+         return conSetting;
+diff --git a/vpnplugins/vpnc/vpnc.h b/vpnplugins/vpnc/vpnc.h
+index 6a9d4b9..0faa269 100644
+--- a/vpnplugins/vpnc/vpnc.h
++++ b/vpnplugins/vpnc/vpnc.h
+@@ -1,6 +1,7 @@
+ /*
+ Copyright 2008 Will Stephenson <wstephenson at kde.org>
+-Copyright 2011 Rajeesh K Nambiar <rajeeshknambiar at gmail.com>
++Copyright 2011-2012 Rajeesh K Nambiar <rajeeshknambiar at gmail.com>
++Copyright 2011-2012 Lamarque V. Souza <lamarque at kde.org>
+ 
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+@@ -40,6 +41,7 @@ public:
+     QString decryptedPasswd;
+     VpncUiPluginPrivate();
+     ~VpncUiPluginPrivate();
++    QString readStringKeyValue(const KConfigGroup & configGroup, const QString & key);
+ protected Q_SLOTS:
+     void gotciscoDecryptOutput();
+     void ciscoDecryptError(QProcess::ProcessError pError);
+-- 
+1.8.0.1
+
diff --git a/0016-Text-formatting.patch b/0016-Text-formatting.patch
new file mode 100644
index 0000000..c079a60
--- /dev/null
+++ b/0016-Text-formatting.patch
@@ -0,0 +1,45 @@
+From faed9a2e618578f02713898e50744092ac4fa8a5 Mon Sep 17 00:00:00 2001
+From: "Lamarque V. Souza" <lamarque at kde.org>
+Date: Wed, 31 Oct 2012 06:22:19 -0200
+Subject: [PATCH 16/26] Text formatting. (cherry picked from commit
+ 6f5d6f3270f08ec8211b5468755621b81c981106)
+
+---
+ vpnplugins/vpnc/vpnc.h | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/vpnplugins/vpnc/vpnc.h b/vpnplugins/vpnc/vpnc.h
+index 0faa269..67165a8 100644
+--- a/vpnplugins/vpnc/vpnc.h
++++ b/vpnplugins/vpnc/vpnc.h
+@@ -27,21 +27,23 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ #include <QVariant>
+ 
++#include <KProcess>
++
+ namespace Knm
+ {
+     class Connection;
+ } // namespace Knm
+ 
+-#include <KProcess>
+-class VpncUiPluginPrivate:public QObject
++class VpncUiPluginPrivate: public QObject
+ {
+ Q_OBJECT
+ public:
+-    KProcess * ciscoDecrypt;
+-    QString decryptedPasswd;
+     VpncUiPluginPrivate();
+     ~VpncUiPluginPrivate();
+     QString readStringKeyValue(const KConfigGroup & configGroup, const QString & key);
++    KProcess * ciscoDecrypt;
++    QString decryptedPasswd;
++
+ protected Q_SLOTS:
+     void gotciscoDecryptOutput();
+     void ciscoDecryptError(QProcess::ProcessError pError);
+-- 
+1.8.0.1
+
diff --git a/0022-Use-correct-default-password-mode.patch b/0022-Use-correct-default-password-mode.patch
new file mode 100644
index 0000000..9f5d983
--- /dev/null
+++ b/0022-Use-correct-default-password-mode.patch
@@ -0,0 +1,86 @@
+From c6ab23e8221c8619d7b830d526f55f6f95a0c8da Mon Sep 17 00:00:00 2001
+From: "Lamarque V. Souza" <lamarque at kde.org>
+Date: Sat, 1 Dec 2012 18:19:00 -0200
+Subject: [PATCH 22/26] Use correct default password mode.
+
+---
+ libs/ui/security/eapmethodleapbase.ui | 4 ++--
+ libs/ui/security/wep.ui               | 4 ++--
+ libs/ui/security/wpapsk.ui            | 4 ++--
+ vpnplugins/openvpn/openvpnprop.ui     | 8 ++++----
+ 4 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libs/ui/security/eapmethodleapbase.ui b/libs/ui/security/eapmethodleapbase.ui
+index 9ae754e..82c428c 100644
+--- a/libs/ui/security/eapmethodleapbase.ui
++++ b/libs/ui/security/eapmethodleapbase.ui
+@@ -56,8 +56,8 @@
+          <property name="toolTip">
+           <string>Password on this network</string>
+          </property>
+-         <property name="echoMode">
+-          <enum>QLineEdit::Password</enum>
++         <property name="passwordMode">
++          <bool>true</bool>
+          </property>
+         </widget>
+        </item>
+diff --git a/libs/ui/security/wep.ui b/libs/ui/security/wep.ui
+index d8d43fe..42a6528 100644
+--- a/libs/ui/security/wep.ui
++++ b/libs/ui/security/wep.ui
+@@ -43,8 +43,8 @@
+      <property name="inputMask">
+       <string notr="true"/>
+      </property>
+-     <property name="echoMode">
+-      <enum>QLineEdit::PasswordEchoOnEdit</enum>
++     <property name="passwordMode">
++      <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+diff --git a/libs/ui/security/wpapsk.ui b/libs/ui/security/wpapsk.ui
+index 8bd6dff..081c4cd 100644
+--- a/libs/ui/security/wpapsk.ui
++++ b/libs/ui/security/wpapsk.ui
+@@ -34,8 +34,8 @@
+      </item>
+      <item row="0" column="1">
+       <widget class="KLineEdit" name="psk">
+-       <property name="echoMode">
+-        <enum>QLineEdit::Password</enum>
++       <property name="passwordMode">
++        <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+diff --git a/vpnplugins/openvpn/openvpnprop.ui b/vpnplugins/openvpn/openvpnprop.ui
+index 96a256a..3d659e1 100644
+--- a/vpnplugins/openvpn/openvpnprop.ui
++++ b/vpnplugins/openvpn/openvpnprop.ui
+@@ -539,8 +539,8 @@
+                  <property name="enabled">
+                   <bool>false</bool>
+                  </property>
+-                 <property name="echoMode">
+-                  <enum>QLineEdit::Password</enum>
++                 <property name="passwordMode">
++                  <bool>true</bool>
+                  </property>
+                 </widget>
+                </item>
+@@ -1103,8 +1103,8 @@
+            <property name="enabled">
+             <bool>false</bool>
+            </property>
+-           <property name="echoMode">
+-            <enum>QLineEdit::Password</enum>
++           <property name="passwordMode">
++            <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+-- 
+1.8.0.1
+
diff --git a/0025-Print-error-message-if-loading-vpn-plugin-fails.patch b/0025-Print-error-message-if-loading-vpn-plugin-fails.patch
new file mode 100644
index 0000000..6ac91d4
--- /dev/null
+++ b/0025-Print-error-message-if-loading-vpn-plugin-fails.patch
@@ -0,0 +1,25 @@
+From 0f57da2bb66a591903c4ecfa61d37decafd6ca7b Mon Sep 17 00:00:00 2001
+From: "Lamarque V. Souza" <lamarque at kde.org>
+Date: Thu, 6 Dec 2012 00:24:10 -0200
+Subject: [PATCH 25/26] Print error message if loading vpn plugin fails.
+
+---
+ libs/ui/connectionsecretsjob.cpp | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/libs/ui/connectionsecretsjob.cpp b/libs/ui/connectionsecretsjob.cpp
+index 3e487ac..75d15b2 100644
+--- a/libs/ui/connectionsecretsjob.cpp
++++ b/libs/ui/connectionsecretsjob.cpp
+@@ -109,6 +109,8 @@ void ConnectionSecretsJob::doAskUser()
+         if (uiPlugin && error.isEmpty()) {
+             m_settingWidget= uiPlugin->askUser(m_connection, 0);
+             buttonCodes = uiPlugin->suggestAuthDialogButtons();
++        } else {
++            kWarning() << "Loading vpn plugin for" << vpnSetting->serviceType() << "failed: " << error;
+         }
+     } else if ( mSettingName == QLatin1String(NM_SETTING_WIRED_SETTING_NAME)) {
+         m_settingWidget = new WiredWidget(m_connection, 0);
+-- 
+1.8.0.1
+
diff --git a/0026-Fix-ConnectionSecretsJob-doAskUser-for-vpn-connectio.patch b/0026-Fix-ConnectionSecretsJob-doAskUser-for-vpn-connectio.patch
new file mode 100644
index 0000000..d930a34
--- /dev/null
+++ b/0026-Fix-ConnectionSecretsJob-doAskUser-for-vpn-connectio.patch
@@ -0,0 +1,26 @@
+From 64988f79dc199bbd4e96db0ea34f8c5bb6450747 Mon Sep 17 00:00:00 2001
+From: "Lamarque V. Souza" <lamarque at kde.org>
+Date: Thu, 6 Dec 2012 01:15:04 -0200
+Subject: [PATCH 26/26] Fix ConnectionSecretsJob::doAskUser() for vpn
+ connections. (cherry picked from commit
+ 0cd908c1c192271707b53df76f49fe3a4c697327)
+
+---
+ backends/NetworkManager/nmdbussecretagent.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/backends/NetworkManager/nmdbussecretagent.cpp b/backends/NetworkManager/nmdbussecretagent.cpp
+index f802604..ae30ee3 100644
+--- a/backends/NetworkManager/nmdbussecretagent.cpp
++++ b/backends/NetworkManager/nmdbussecretagent.cpp
+@@ -94,6 +94,7 @@ QVariantMapMap NMDBusSecretAgent::GetSecrets(const QVariantMapMap &connection, c
+     msg.setDelayedReply(true);
+     Knm::Connection * con = new Knm::Connection(QUuid(), Knm::Connection::Wired);
+     ConnectionDbus condbus(con);
++    condbus.fromDbusMap(connection);
+     condbus.fromDbusSecretsMap(connection);
+     QPair<QString,QDBusMessage> pair;
+     pair.first = connection_path.path();
+-- 
+1.8.0.1
+
diff --git a/kde-plasma-networkmanagement.spec b/kde-plasma-networkmanagement.spec
index e2d915d..9ea8ab2 100644
--- a/kde-plasma-networkmanagement.spec
+++ b/kde-plasma-networkmanagement.spec
@@ -1,7 +1,7 @@
 Name:           kde-plasma-networkmanagement
 Epoch:          1
 Version:        0.9.0.5
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        NetworkManager KDE 4 integration
 
 Group:          Applications/Internet
@@ -16,7 +16,14 @@ Source0:        http://download.kde.org/unstable/networkmanagement/%{version}/sr
 Source10: 00-fedora-networkmanagement.js
 
 ## upstream patches
-
+Patch102: 0002-Add-warning-about-things-that-must-not-go-to-the-log.patch
+Patch104: 0004-Pre-fill-secrets-in-password-dialog-for-wifi-connect.patch
+Patch114: 0014-guard-QWaitCondtion-wakeAll-call-with-mutex-lock-unl.patch
+Patch115: 0015-CISCO-vpn-pcf-files-can-have-string-keys-either-as-k.patch
+Patch116: 0016-Text-formatting.patch
+Patch122: 0022-Use-correct-default-password-mode.patch
+patch125: 0025-Print-error-message-if-loading-vpn-plugin-fails.patch
+Patch126: 0026-Fix-ConnectionSecretsJob-doAskUser-for-vpn-connectio.patch
 
 BuildRequires:  gettext
 BuildRequires:  kdelibs4-devel
@@ -98,6 +105,15 @@ Requires:       NetworkManager-openconnect
 %prep
 %setup -q -n networkmanagement-%{version}
 
+%patch102 -p1 -b .0002
+%patch104 -p1 -b .0004
+%patch114 -p1 -b .0014
+%patch115 -p1 -b .0015
+%patch116 -p1 -b .0016
+%patch122 -p1 -b .0022
+%patch125 -p1 -b .0025
+%patch126 -p1 -b .0026
+
 
 
 %build
@@ -229,6 +245,9 @@ gtk-update-icon-cache %{_kde4_iconsdir}/oxygen &> /dev/null || :
 
 
 %changelog
+* Thu Dec 06 2012 Rex Dieter <rdieter at fedoraproject.org> 0.9.0.5-3
+- backport upstream vpn-related fixes (#882308)
+
 * Fri Nov 09 2012 Rex Dieter <rdieter at fedoraproject.org> 0.9.0.5-2
 - +plasma-dataengine-depextractor support
 


More information about the scm-commits mailing list