Group :: Sistema/Bibliotecas
RPM: kf5-kwallet
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: alt-create-wallet.patch
Download
Download
--- kwallet/src/runtime/kwalletd/kwalletd.cpp
+++ kwallet/src/runtime/kwalletd/kwalletd.cpp
@@ -704,8 +704,7 @@ int KWalletD::internalOpen(const QString
gpgKey = newWalletDlg->gpgKey();
} else {
// user cancelled the dialog box
- delete b;
- return -1;
+ createWithEmptyPassword(b);
}
if (newWalletType == KWallet::BACKEND_CIPHER_GPG) {
@@ -761,6 +760,7 @@ int KWalletD::internalOpen(const QString
KWallet::Backend::openRCToString(rc)));
}
} else {
+ createWithEmptyPassword(b);
break;
}
}
@@ -1861,6 +1861,27 @@ void KWalletD::activatePasswordDialog()
checkActiveDialog();
}
+void KWalletD::createWithEmptyPassword(KWallet::Backend *b)
+{
+ b->setCipherType(KWallet::BACKEND_CIPHER_BLOWFISH);
+ QString password = "";
+ int rc = b->open(password.toUtf8());
+ if (!rc) {
+ KNotification::event(KNotification::Warning,
+ QString(),
+ i18n("<qt>The wallet was created "
+ "with an <b>empty password</b>.</qt>"),
+ QApplication::activeWindow());
+ } else {
+ KNotification::event(KNotification::Error,
+ QString(),
+ i18n("Error creating the wallet. "
+ "Please try again. (Error code %1: %2)",
+ rc, KWallet::Backend::openRCToString(rc)),
+ QApplication::activeWindow());
+ }
+}
+
int KWalletD::pamOpen(const QString &wallet, const QByteArray &passwordHash, int sessionTimeout)
{
if (_processing) {
--- kwallet/src/runtime/kwalletd/kwalletd.h
+++ kwallet/src/runtime/kwalletd/kwalletd.h
@@ -46,6 +46,9 @@ public:
// Close and lock the wallet
// Accepts "message" for working from other QDBusContexts
int close(int handle, bool force, const QString &appid, const QDBusMessage &message);
+
+ void createWithEmptyPassword(KWallet::Backend *b);
+
public Q_SLOTS:
// Is the wallet enabled? If not, all open() calls fail.