]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Only log when there's an actual error
authorGrégory Oestreicher <greg@kamago.net>
Wed, 12 Apr 2017 19:26:22 +0000 (21:26 +0200)
committerGrégory Oestreicher <greg@kamago.net>
Tue, 10 Apr 2018 19:52:56 +0000 (21:52 +0200)
modules/ldapbackend/ldapauthenticator.cc

index 12a43fd202c9c977b014f2ea7059c23f268307a8..77577ad47590d70aae73a54ddcce4a1e1ac19f12 100644 (file)
@@ -249,11 +249,13 @@ int LdapGssapiAuthenticator::updateTgt()
   krb5_free_principal( context, principal );
 
   if ( code == 0 ) {
-    g_log<<Logger::Error << logPrefix << "krb5 error when getting the TGT: " << std::string( krb5_get_error_message( context, code ) ) << std::endl;
     code = krb5_cc_store_cred( context, ccache, &credentials );
     krb5_free_cred_contents( context, &credentials );
     krb5_cc_close( context, ccache );
   }
+  else {
+    g_log<<Logger::Error << logPrefix << "krb5 error when getting the TGT: " << std::string( krb5_get_error_message( context, code ) ) << std::endl;
+  }
 
   krb5_free_context( context );
   return code;