summaryrefslogtreecommitdiffstats
path: root/tdeio/misc
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2018-12-28 00:20:28 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2018-12-28 00:20:28 +0900
commit6b3ce66088007091a5f33c25676b93856451d59b (patch)
treee88973dece654b405a28f55c66dd39cadce1bb5e /tdeio/misc
parentcfb7075fa223fb7b5a97571bf56f7ce56d492339 (diff)
downloadtdelibs-6b3ce66088007091a5f33c25676b93856451d59b.tar.gz
tdelibs-6b3ce66088007091a5f33c25676b93856451d59b.zip
Fixed access to TDE wallets created before R14.0.6 that uses special non-ascii characters in their password.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdeio/misc')
-rw-r--r--tdeio/misc/tdewalletd/tdewalletd.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tdeio/misc/tdewalletd/tdewalletd.cpp b/tdeio/misc/tdewalletd/tdewalletd.cpp
index 99288bc8c..0aaec0f9a 100644
--- a/tdeio/misc/tdewalletd/tdewalletd.cpp
+++ b/tdeio/misc/tdewalletd/tdewalletd.cpp
@@ -479,8 +479,13 @@ int TDEWalletD::internalOpen(const TQCString& appid, const TQString& wallet, boo
p = kpd->password().utf8();
int rc = b->open(TQByteArray().duplicate(p, p.length()));
if (!b->isOpen()) {
- kpd->setPrompt(i18n("<qt>Error opening the wallet '<b>%1</b>'. Please try again.<br>(Error code %2: %3)").arg(TQStyleSheet::escape(wallet)).arg(rc).arg(TDEWallet::Backend::openRCToString(rc)));
- kpd->clearPassword();
+ // For compatibility with TDE << T14.0.6, try ascii() as fallback option in case of errors
+ p = kpd->password().ascii();
+ rc = b->open(TQByteArray().duplicate(p, p.length()));
+ if (!b->isOpen()) {
+ kpd->setPrompt(i18n("<qt>Error opening the wallet '<b>%1</b>'. Please try again.<br>(Error code %2: %3)").arg(TQStyleSheet::escape(wallet)).arg(rc).arg(TDEWallet::Backend::openRCToString(rc)));
+ kpd->clearPassword();
+ }
}
} else {
break;