Hi,
the attached patch fixes BMC#21311 by invoking
SyncConfig::checkPassword also when doing --print-items.

commit ac9df6a857d4883e2932c14a885a664b15ee618a
Author: Salvatore Iovene <[email protected]>
Date:   Wed Aug 3 12:08:02 2011 +0300

    Fixes BMC#21311 - item operations: authentication problem for
WebDAV when using keyring

    Use checkPassword() before trying to --print-items. This will either
    prompt for the password at command line, or ask it from the keyring
    if --keyring is specified (or if using the dbus server).

commit 1f48eb3a5905839269b7ad51bf19686d2d1c9bc6
Author: Salvatore Iovene <[email protected]>
Date:   Wed Aug 3 10:37:57 2011 +0300

    Cmdline.cpp: we don't need *both* gnome-keyring and kwallet to
store the pwd.

Please review.

-- 
Salvatore Iovene <[email protected]>
Linux Software Engineer
Intel Open Source Technology Center, Finland
Tel.: +358504804026
diff --git a/src/syncevo/Cmdline.cpp b/src/syncevo/Cmdline.cpp
index a07ca56..518f64a 100644
--- a/src/syncevo/Cmdline.cpp
+++ b/src/syncevo/Cmdline.cpp
@@ -742,19 +742,12 @@ bool Cmdline::run() {
             SyncContext::throwError("--dry-run not supported for configuration changes");
         }
         if (m_keyring) {
-#ifndef USE_GNOME_KEYRING
+#if (!defined USE_GNOME_KEYRING) and (!defined USE_KDE_KWALLET)
             m_err << "Error: this syncevolution binary was compiled without support for storing "
-                     "passwords in a keyring. Either store passwords in your configuration "
+                     "passwords in a keyring or wallet. Either store passwords in your configuration "
                      "files or enter them interactively on each program run." << endl;
             return false;
 #endif
-#ifndef USE_KDE_KWALLET
-            m_err << "Error: this syncevolution binary was compiled without support for storing "
-                     "passwords in a wallet. Either store passwords in your configuration "
-                     "files or enter them interactively on each program run." << endl;
-            return false;
-#endif
-
         }
 
         // name of renamed config ("foo.old") after migration
@@ -1156,6 +1149,12 @@ bool Cmdline::run() {
                 !ops.m_readNextItem) {
                 source->throwError("reading items not supported");
             }
+
+            ConfigPropertyRegistry& registry = SyncConfig::getRegistry();
+            BOOST_FOREACH(const ConfigProperty *prop, registry) {
+                prop->checkPassword(*context, m_server, *context->getProperties());
+            }
+
             err = ops.m_startDataRead("", "");
             CHECK_ERROR("reading items");
             list<string> luids;
_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution

Reply via email to