Hello community,

here is the log from the commit of package kdebase4-runtime for 
openSUSE:Factory checked in at 2015-02-22 17:26:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdebase4-runtime (Old)
 and      /work/SRC/openSUSE:Factory/.kdebase4-runtime.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kdebase4-runtime"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kdebase4-runtime/kdebase4-runtime.changes        
2015-02-11 16:35:54.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.kdebase4-runtime.new/kdebase4-runtime.changes   
2015-02-22 17:26:01.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Feb 18 19:48:26 UTC 2015 - [email protected]
+
+- Add fix-for-the-random-wallet-open-failure-when-updating.patch
+  from upstream (kde#343718, boo#917988)
+
+-------------------------------------------------------------------

New:
----
  fix-for-the-random-wallet-open-failure-when-updating.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdebase4-runtime.spec ++++++
--- /var/tmp/diff_new_pack.EPkGSW/_old  2015-02-22 17:26:02.000000000 +0100
+++ /var/tmp/diff_new_pack.EPkGSW/_new  2015-02-22 17:26:02.000000000 +0100
@@ -37,6 +37,8 @@
 Patch6:         Remove-volume-control-from-KNotify.patch
 # PATCH-FIX-OPENSUSE kdesu-add-some-i18n-love.patch -- bnc#852256
 Patch7:         kdesu-add-some-i18n-love.patch
+# PATCH-FIX-UPSTREAM fix-for-the-random-wallet-open-failure-when-updating.patch
+Patch8:         fix-for-the-random-wallet-open-failure-when-updating.patch
 BuildRequires:  NetworkManager-devel
 BuildRequires:  alsa-devel
 BuildRequires:  automoc4
@@ -129,6 +131,7 @@
 %patch6 -p1
 %endif
 %patch7 -p1
+%patch8 -p1
 
 %build
   %cmake_kde4 -d build -- -DKDE4_ENABLE_FPIE=1


++++++ fix-for-the-random-wallet-open-failure-when-updating.patch ++++++
commit 345e36a8b35e2c6f8fcda50d0776d77102d6648a
Author: Valentin Rusu <[email protected]>
Date:   Mon Feb 16 22:44:07 2015 +0100

    Fix for the random wallet open failure when updating
    
    The problem seems to be caused by the use of BackendPersistHandler
    singleton when the user has several wallets on his system and not
    all of them have been updated to the new schema.
    
    BUG: 343718

diff --git a/kwalletd/backend/backendpersisthandler.cpp 
b/kwalletd/backend/backendpersisthandler.cpp
index 5c321c9..b7f63f8 100644
--- a/kwalletd/backend/backendpersisthandler.cpp
+++ b/kwalletd/backend/backendpersisthandler.cpp
@@ -140,25 +140,14 @@ static int getRandomBlock(QByteArray& randBlock) {
 #endif
 }
 
-
-
-static BlowfishPersistHandler *blowfishHandler =0;
-#ifdef HAVE_QGPGME
-static GpgPersistHandler *gpgHandler =0;
-#endif // HAVE_QGPGME
-
 BackendPersistHandler 
*BackendPersistHandler::getPersistHandler(BackendCipherType cipherType)
 {
     switch (cipherType){
         case BACKEND_CIPHER_BLOWFISH:
-            if (0 == blowfishHandler)
-                blowfishHandler = new BlowfishPersistHandler;
-            return blowfishHandler;
+            return new BlowfishPersistHandler;
 #ifdef HAVE_QGPGME
         case BACKEND_CIPHER_GPG:
-            if (0 == gpgHandler)
-                gpgHandler = new GpgPersistHandler;
-            return gpgHandler;
+            return new GpgPersistHandler;
 #endif // HAVE_QGPGME
         default:
             Q_ASSERT(0);
@@ -170,21 +159,16 @@ BackendPersistHandler 
*BackendPersistHandler::getPersistHandler(char magicBuf[12
 {
     if ((magicBuf[2] == KWALLET_CIPHER_BLOWFISH_ECB || magicBuf[2] == 
KWALLET_CIPHER_BLOWFISH_CBC) &&
         (magicBuf[3] == KWALLET_HASH_SHA1 || magicBuf[3] == 
KWALLET_HASH_PBKDF2_SHA512)) {
-        if (0 == blowfishHandler) {
-            bool useECBforReading = magicBuf[2] == KWALLET_CIPHER_BLOWFISH_ECB;
-            if (useECBforReading) {
-                qDebug() << "this wallet uses ECB encryption. It'll be 
converted to CBC on next save.";
-            }
-            blowfishHandler = new BlowfishPersistHandler(useECBforReading);
+        bool useECBforReading = magicBuf[2] == KWALLET_CIPHER_BLOWFISH_ECB;
+        if (useECBforReading) {
+            qDebug() << "this wallet uses ECB encryption. It'll be converted 
to CBC on next save.";
         }
-        return blowfishHandler;
+        return new BlowfishPersistHandler(useECBforReading);
     }
 #ifdef HAVE_QGPGME
     if (magicBuf[2] == KWALLET_CIPHER_GPG &&
         magicBuf[3] == 0) {
-        if (0 == gpgHandler)
-            gpgHandler = new GpgPersistHandler;
-        return gpgHandler;
+        return new GpgPersistHandler;
     }
 #endif // HAVE_QGPGME
     return 0;    // unknown cipher or hash
diff --git a/kwalletd/backend/kwalletbackend.cc 
b/kwalletd/backend/kwalletbackend.cc
index 7d439e3..9240103 100644
--- a/kwalletd/backend/kwalletbackend.cc
+++ b/kwalletd/backend/kwalletbackend.cc
@@ -266,7 +266,7 @@ int Backend::open(const QByteArray& password, WId w) {
        if (_open) {
                return -255;  // already open
        }
-       
+
        setPassword(password);
    return openInternal(w);
 }
@@ -287,20 +287,20 @@ int Backend::openPreHashed(const QByteArray &passwordHash)
    if (_open) {
       return -255;  // already open
    }
-   
+
    // check the password hash for correct size (currently fixed)
    if (passwordHash.size() != 20 && passwordHash.size() != 40 &&
           passwordHash.size() != 56) {
       return -42; // unsupported encryption scheme
    }
-   
+
    _passhash = passwordHash;
    _newPassHash = passwordHash;
    _useNewHash = true;//Only new hash is supported
 
    return openInternal();
 }
- 
+
 int Backend::openInternal(WId w)
 {
        // No wallet existed.  Let's create it.
@@ -350,7 +350,9 @@ int Backend::openInternal(WId w)
     if (0 == phandler){
         return 42; // unknown cipher or hash
     }
-    return phandler->read(this, db, w);
+    int result = phandler->read(this, db, w);
+    delete phandler;
+    return result;
 }
 
 void Backend::swapToNewHash()
@@ -427,6 +429,7 @@ int Backend::sync(WId w) {
         notification->setText( i18n("Failed to sync wallet <b>%1</b> to disk. 
Error codes are:\nRC <b>%2</b>\nSF <b>%3</b>. Please file a BUG report using 
this information to bugs.kde.org").arg(_name).arg(rc).arg(sf.errorString()) );
         notification->sendEvent();
     }
+    delete phandler;
     return rc;
 }
 
@@ -439,7 +442,7 @@ int Backend::close(bool save) {
                        return rc;
                }
        }
-       
+
        // do the actual close
        for (FolderMap::ConstIterator i = _entries.constBegin(); i != 
_entries.constEnd(); ++i) {
                for (EntryMap::ConstIterator j = i.value().constBegin(); j != 
i.value().constEnd(); ++j) {
@@ -447,13 +450,13 @@ int Backend::close(bool save) {
                }
        }
        _entries.clear();
-       
+
        // empty the password hash
        _passhash.fill(0);
     _newPassHash.fill(0);
 
        _open = false;
-       
+
        return 0;
 }
 
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to