Browse Source

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>
pull/15/head
Michele Calgaro 6 months ago
parent
commit
6b3ce66088
Signed by: Michele Calgaro <michele.calgaro@yahoo.it> GPG Key ID: 2A75B7CA8ADED5CF
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      tdeio/misc/tdewalletd/tdewalletd.cpp

+ 7
- 2
tdeio/misc/tdewalletd/tdewalletd.cpp View File

@@ -479,8 +479,13 @@ int TDEWalletD::internalOpen(const TQCString& appid, const TQString& wallet, boo
479 479
 				p = kpd->password().utf8();
480 480
 				int rc = b->open(TQByteArray().duplicate(p, p.length()));
481 481
 				if (!b->isOpen()) {
482
-					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)));
483
-					kpd->clearPassword();
482
+					// For compatibility with TDE << T14.0.6, try ascii() as fallback option in case of errors
483
+					p = kpd->password().ascii();
484
+					rc = b->open(TQByteArray().duplicate(p, p.length()));
485
+					if (!b->isOpen()) {
486
+						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)));
487
+						kpd->clearPassword();
488
+					}
484 489
 				}
485 490
 			} else {
486 491
 				break;

Loading…
Cancel
Save