From 3b7887ca35c5d0802c831a6b4ff0c099f47deeef Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Wed, 21 Dec 2016 15:04:37 +0100 Subject: [PATCH] Wizard: Detach saved account from wizard Fixes #5408 #5407. The problem was that cleanup of the credentials page set the credentials of the account back to dummy, thereby overriding things like shib usernames. This should be broken since a932eac832b442cca763197240f036905dd284da. --- src/gui/owncloudsetupwizard.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp index 5b36e44c2..2eb7ed37c 100644 --- a/src/gui/owncloudsetupwizard.cpp +++ b/src/gui/owncloudsetupwizard.cpp @@ -553,6 +553,13 @@ void OwncloudSetupWizard::slotSkipFolderConfiguration() AccountState *OwncloudSetupWizard::applyAccountChanges() { AccountPtr newAccount = _ocWizard->account(); + + // Detach the account that is going to be saved from the + // wizard to ensure it doesn't accidentally get modified + // later (such as from running cleanup such as + // AbstractCredentialsWizardPage::cleanupPage()) + _ocWizard->setAccount(AccountManager::createAccount()); + auto manager = AccountManager::instance(); auto newState = manager->addAccount(newAccount); -- 2.30.2