Skip to content

Commit 7c03619

Browse files
committedSep 28, 2015
Fix coverity unreachable code error
1 parent 808a432 commit 7c03619

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed
 

‎src/core/auth/qgsauthmanager.cpp

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3006,6 +3006,13 @@ bool QgsAuthManager::reencryptAuthenticationConfig( const QString &authcfg, cons
30063006
{
30073007
QString configstring( QgsAuthCrypto::decrypt( prevpass, prevciv, query.value( 0 ).toString() ) );
30083008

3009+
if ( query.next() )
3010+
{
3011+
QgsDebugMsg( QString( "Select contains more than one for authcfg: %1" ).arg( authcfg ) );
3012+
emit messageOut( tr( "Authentication database contains duplicate configuration IDs" ), authManTag(), WARNING );
3013+
return false;
3014+
}
3015+
30093016
query.clear();
30103017

30113018
query.prepare( QString( "UPDATE %1 "
@@ -3032,14 +3039,6 @@ bool QgsAuthManager::reencryptAuthenticationConfig( const QString &authcfg, cons
30323039
QgsDebugMsg( QString( "Reencrypt FAILED, could not find in db authcfg: %2" ).arg( authcfg ) );
30333040
return false;
30343041
}
3035-
3036-
if ( query.next() )
3037-
{
3038-
QgsDebugMsg( QString( "Select contains more than one for authcfg: %1" ).arg( authcfg ) );
3039-
emit messageOut( tr( "Authentication database contains duplicate configuration IDs" ), authManTag(), WARNING );
3040-
}
3041-
3042-
return false;
30433042
}
30443043

30453044
bool QgsAuthManager::reencryptAllAuthenticationSettings( const QString &prevpass, const QString &prevciv )
@@ -3169,6 +3168,13 @@ bool QgsAuthManager::reencryptAuthenticationIdentity(
31693168
{
31703169
QString keystring( QgsAuthCrypto::decrypt( prevpass, prevciv, query.value( 0 ).toString() ) );
31713170

3171+
if ( query.next() )
3172+
{
3173+
QgsDebugMsg( QString( "Select contains more than one for identity id: %1" ).arg( identid ) );
3174+
emit messageOut( tr( "Authentication database contains duplicate identity IDs" ), authManTag(), WARNING );
3175+
return false;
3176+
}
3177+
31723178
query.clear();
31733179

31743180
query.prepare( QString( "UPDATE %1 "
@@ -3195,15 +3201,6 @@ bool QgsAuthManager::reencryptAuthenticationIdentity(
31953201
QgsDebugMsg( QString( "Reencrypt FAILED, could not find in db identity id: %2" ).arg( identid ) );
31963202
return false;
31973203
}
3198-
3199-
if ( query.next() )
3200-
{
3201-
QgsDebugMsg( QString( "Select contains more than one for identity id: %1" ).arg( identid ) );
3202-
emit messageOut( tr( "Authentication database contains duplicate identity IDs" ), authManTag(), WARNING );
3203-
}
3204-
3205-
return false;
3206-
32073204
}
32083205

32093206
bool QgsAuthManager::authDbOpen() const

0 commit comments

Comments
 (0)
Failed to load comments.