[Pkg-owncloud-commits] [qtkeychain] 36/115: Detect if opening the wallet failed. (Assuming that the user denied access)

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Mar 15 19:25:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository qtkeychain.

commit be96f4c514281ec78fecb8116806518bed429837
Author: Frank Osterfeld <frank.osterfeld at kdab.com>
Date:   Tue May 8 17:38:14 2012 +0200

    Detect if opening the wallet failed.
    (Assuming that the user denied access)
---
 keychain_dbus.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/keychain_dbus.cpp b/keychain_dbus.cpp
index 3c57378..7273e74 100644
--- a/keychain_dbus.cpp
+++ b/keychain_dbus.cpp
@@ -33,6 +33,11 @@ void ReadPasswordJob::Private::kwalletOpenFinished( QDBusPendingCallWatcher* wat
 
     walletHandle = reply.value();
 
+    if ( walletHandle < 0 ) {
+        q->emitFinishedWithError( AccessDenied, tr("Access to keychain denied") );
+        return;
+    }
+
     const QDBusPendingReply<int> nextReply = iface->entryType( walletHandle, q->service(), key, q->service() );
     QDBusPendingCallWatcher* nextWatcher = new QDBusPendingCallWatcher( nextReply, this );
     connect( nextWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletEntryTypeFinished(QDBusPendingCallWatcher*)) );
@@ -93,6 +98,11 @@ void WritePasswordJob::Private::kwalletOpenFinished( QDBusPendingCallWatcher* wa
 
     const int handle = reply.value();
 
+    if ( handle < 0 ) {
+        q->emitFinishedWithError( AccessDenied, tr("Access to keychain denied") );
+        return;
+    }
+
     QDBusPendingReply<int> nextReply;
 
     if ( !textData.isEmpty() )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/qtkeychain.git



More information about the Pkg-owncloud-commits mailing list