Skip to content

Commit

Permalink
[authentication manager] Avoid crossing mutex wires when checking for…
Browse files Browse the repository at this point in the history
… master password
  • Loading branch information
nirvn authored and nyalldawson committed May 15, 2020
1 parent f9b067e commit 17d5377
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/auth/qgsauthmanager.cpp
Expand Up @@ -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
{
Expand Down Expand Up @@ -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 )
{
Expand Down

0 comments on commit 17d5377

Please sign in to comment.