From 52e8c464a1cb8ad22842329a84f96946c47fc369 Mon Sep 17 00:00:00 2001 From: Bernd Wachter Date: Tue, 23 Dec 2014 14:35:22 +0200 Subject: [PATCH] [ssu] Allow passing store credential errors down to libzypp If a device is reasonably broken the UI level might not be available. Until the updated related components from store are available fully in middleware this provides a workaround to rescue such devices, given valid store credentials were written once before --- libssu/ssu.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libssu/ssu.cpp b/libssu/ssu.cpp index 6cdc420..ff2c00b 100644 --- a/libssu/ssu.cpp +++ b/libssu/ssu.cpp @@ -633,6 +633,9 @@ void Ssu::updateCredentials(bool force){ } void Ssu::updateStoreCredentials(){ + SsuCoreConfig *settings = SsuCoreConfig::instance(); + SsuLog *ssuLog = SsuLog::instance(); + QDBusMessage message = QDBusMessage::createMethodCall("com.jolla.jollastore", "/StoreClient", "com.jolla.jollastore", @@ -640,7 +643,11 @@ void Ssu::updateStoreCredentials(){ QDBusPendingReply reply = SsuCoreConfig::userSessionBus().asyncCall(message); reply.waitForFinished(); if (reply.isError()) { - setError(QString("Store credentials not received. %1").arg(reply.error().message())); + if (settings->value("ignore-credential-errors").toBool() == true){ + ssuLog->print(LOG_WARNING, QString("Warning: ignore-credential-errors is set, passing auth errors down to libzypp")); + ssuLog->print(LOG_WARNING, QString("Store credentials not received. %1").arg(reply.error().message())); + } else + setError(QString("Store credentials not received. %1").arg(reply.error().message())); } else { SsuCoreConfig *settings = SsuCoreConfig::instance(); settings->beginGroup("credentials-store");