Skip to content
Permalink
Browse files

[authentication manager] Avoid crossing mutex wires when checking for…

… master password
  • Loading branch information
nirvn authored and nyalldawson committed May 15, 2020
1 parent f9b067e commit 17d5377cdf7602cd3d55690614d3edd6f151f770
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/auth/qgsauthmanager.cpp
@@ -501,11 +501,13 @@ bool QgsAuthManager::setMasterPassword( bool verify )
if ( mMasterPass.isEmpty() )
{
QgsDebugMsg( QStringLiteral( "Master password is not yet set by user" ) );
locker.unlock();
if ( !masterPasswordInput() )
{
QgsDebugMsg( QStringLiteral( "Master password input canceled by user" ) );
return false;
}
locker.relock();
}
else
{
@@ -1204,13 +1206,14 @@ bool QgsAuthManager::updateAuthenticationConfig( const QgsAuthMethodConfig &conf

bool QgsAuthManager::loadAuthenticationConfig( const QString &authcfg, QgsAuthMethodConfig &mconfig, bool full )
{
QMutexLocker locker( mMutex );
if ( isDisabled() )
return false;

if ( full && !setMasterPassword( true ) )
return false;

QMutexLocker locker( mMutex );

QSqlQuery query( authDatabaseConnection() );
if ( full )
{

0 comments on commit 17d5377

Please sign in to comment.
You can’t perform that action at this time.