Removed redundant log messages

Moved logging from functions that perform user authentication to the code that
uses these functions. This way the messages are only logged once.
This commit is contained in:
Markus Makela
2015-11-02 15:52:12 +02:00
parent 142c22c2a8
commit 24ee9ca675
2 changed files with 12 additions and 15 deletions

View File

@ -608,11 +608,18 @@ static int gw_mysql_do_authentication(DCB *dcb, GWBUF **buf) {
dcb->user = strdup(client_data->user); dcb->user = strdup(client_data->user);
} }
else else
{ {
skygw_log_write(LOGFILE_ERROR, skygw_log_write(LM, "%s: login attempt for user '%s', authentication failed.",
"%s: login attempt for user '%s', authentication failed.", dcb->service->name, username);
dcb->service->name, username); if (dcb->ipv4.sin_addr.s_addr == 0x0100007F &&
} !dcb->service->localhost_match_wildcard_host)
{
skygw_log_write_flush(LM, "If you have a wildcard grant that covers"
" this address, try adding "
"'localhost_match_wildcard_host=true' for "
"service '%s'. ", dcb->service->name);
}
}
/* let's free the auth_token now */ /* let's free the auth_token now */
if (auth_token) { if (auth_token) {

View File

@ -1489,16 +1489,6 @@ int gw_find_mysql_user_password_sha1(char *username, uint8_t *gateway_password,
!dcb->service->localhost_match_wildcard_host) !dcb->service->localhost_match_wildcard_host)
{ {
/* Skip the wildcard check and return 1 */ /* Skip the wildcard check and return 1 */
LOGIF(LE,
(skygw_log_write_flush(
LOGFILE_ERROR,
"Error : user %s@%s not found, try set "
"'localhost_match_wildcard_host=1' in "
"service definition of the configuration "
"file.",
key.user,
dcb->remote)));
break; break;
} }