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 Apr 25, 2020
1 parent fc2cb76 commit 048d1ade608e771813257a8a37040bb45deef818
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/auth/qgsauthmanager.cpp
@@ -497,11 +497,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
{
@@ -1200,13 +1202,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 048d1ad

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