diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-12-30 02:52:55 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-12-30 02:52:55 +0100 |
commit | 987768c54d8f0c0ead70395057172ae765fae064 (patch) | |
tree | 5bca2d10f7c2fa7c18ac906b2b4b7a8fa535d373 /tdeio/misc/tdewalletd | |
parent | 7d8d7f102a6c17a7a8ceb2082e19c3f742a6c91e (diff) | |
download | tdelibs-987768c54d8f0c0ead70395057172ae765fae064.tar.gz tdelibs-987768c54d8f0c0ead70395057172ae765fae064.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>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdeio/misc/tdewalletd')
-rw-r--r-- | tdeio/misc/tdewalletd/tdewalletd.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tdeio/misc/tdewalletd/tdewalletd.cpp b/tdeio/misc/tdewalletd/tdewalletd.cpp index 5d73df4e6..a9b333288 100644 --- a/tdeio/misc/tdewalletd/tdewalletd.cpp +++ b/tdeio/misc/tdewalletd/tdewalletd.cpp @@ -479,8 +479,14 @@ int TDEWalletD::internalOpen(const TQCString& appid, const TQString& wallet, boo p = kpd->password(); int rc = b->open(TQByteArray().duplicate(p, strlen(p))); 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 << R14.0.6, try ascii() as fallback option in case of errors + TQString pw8Bit = TQString::fromLocal8Bit(p); + p = pw8Bit.ascii(); + rc = b->open(TQByteArray().duplicate(p, strlen(p))); + 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; |