[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: [Patch] Wallet support for KMail
From:       Volker Krause <volker.krause () rwth-aachen ! de>
Date:       2004-09-01 11:30:39
Message-ID: 200409011330.39777.volker.krause () rwth-aachen ! de
[Download RAW message or body]

On Tuesday 31 August 2004 16:54, Volker Krause wrote:
> On Tuesday 31 August 2004 11:08, Stephan Kulow wrote:
> > Am Montag 30 August 2004 19:05 schrieb Volker Krause:
> > > If password storage is disabled, KMail should only access the wallet if
> > > it already contains the password and delete it (checking if a key
> > > exists should work without opening the wallet).
> >
> > Afaik there are bugs left in kwallet about that hashing. George promised
> > to fix these for KDE 3.3.1, so I hope he does.
>
> There seems to be indeed a problem with KWallet and its keyDoesNotExist()
> call. After creating a new entry you need to close and reopen the wallet to
> get a correct result of keyDoesNotExist(). The attached shell script
> demonstrates this.

The attached patch works around the KWallet bug by using keyDoesNotExist() 
only if the wallet is closed and using hasEntry() otherwise.

Should I commit or wait until this gets fixed in KWallet?

regards
Volker

["wallet-bug-workaround.diff" (text/x-diff)]

? .kateconfig
? kmail-wallet.diff
? kmail-wallet2.diff
? kmail-wallet3.diff
? kmail-wallet4.diff
? kmail.kdevelop
? kmail.kdevelop.pcs
? kmail.kdevses
? wallet-bug.sh
Index: kmtransport.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmtransport.cpp,v
retrieving revision 1.41
diff -U3 -r1.41 kmtransport.cpp
--- kmtransport.cpp	31 Aug 2004 12:45:58 -0000	1.41
+++ kmtransport.cpp	1 Sep 2004 11:17:38 -0000
@@ -199,7 +199,8 @@
   if ( !storePasswd() || !auth )
     return;
 
-  if ( Wallet::folderDoesNotExist(Wallet::NetworkWallet(), "kmail") ||
+  if ( Wallet::isOpen( Wallet::NetworkWallet() ) ?
+       !kmkernel->wallet()->hasEntry( "transport-" + QString::number(mId) ) :
        Wallet::keyDoesNotExist( Wallet::NetworkWallet(), "kmail", "transport-" + \
QString::number(mId) ) )  return;
 
Index: networkaccount.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/networkaccount.cpp,v
retrieving revision 1.10
diff -U3 -r1.10 networkaccount.cpp
--- networkaccount.cpp	28 Aug 2004 09:26:32 -0000	1.10
+++ networkaccount.cpp	1 Sep 2004 11:17:39 -0000
@@ -258,8 +258,9 @@
     if ( !storePasswd() )
       return;
 
-    if ( Wallet::folderDoesNotExist( Wallet::NetworkWallet(), "kmail" ) ||
-          Wallet::keyDoesNotExist( Wallet::NetworkWallet(), "kmail", "account-" + \
QString::number(mId) ) ) +    if ( Wallet::isOpen( Wallet::NetworkWallet() ) ?
+         !kmkernel->wallet()->hasEntry( "account-" + QString::number(mId) ) :
+         Wallet::keyDoesNotExist( Wallet::NetworkWallet(), "kmail", "account-" + \
QString::number(mId) ) )  return;
 
     if ( kmkernel->wallet() ) {



_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic