From 7108add6f5c079cf60899e93048864e85e15598e Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Fri, 12 Sep 2014 17:21:34 +0200 Subject: [PATCH] code cleanup localhost_match_wildcard_host code cleanup for localhost_match_wildcard_host --- server/core/config.c | 5 +++-- server/core/service.c | 2 +- server/modules/protocol/mysql_client.c | 1 + server/modules/protocol/mysql_common.c | 8 +++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/core/config.c b/server/core/config.c index 3d12ac645..21d3321a4 100644 --- a/server/core/config.c +++ b/server/core/config.c @@ -1206,7 +1206,7 @@ SERVER *server; version_string = config_get_value(obj->parameters, "version_string"); - allow_localhost_match_wildcardi_host = config_get_value(obj->parameters, "localhost_match_wildcard_host"); + allow_localhost_match_wildcard_host = config_get_value(obj->parameters, "localhost_match_wildcard_host"); if (version_string) { if (service->version_string) { @@ -1320,6 +1320,7 @@ SERVER *server; char *user; char *auth; char *enable_root_user; + char *allow_localhost_match_wildcard_host; enable_root_user = config_get_value(obj->parameters, @@ -1343,7 +1344,7 @@ SERVER *server; serviceEnableRootUser(service, atoi(enable_root_user)); if (allow_localhost_match_wildcard_host) - serviceEnableLocalhostMatchAny( + serviceEnableLocalhostMatchWildcardHost( service, atoi(allow_localhost_match_wildcard_host)); } diff --git a/server/core/service.c b/server/core/service.c index f36474645..a5e08f937 100644 --- a/server/core/service.c +++ b/server/core/service.c @@ -129,7 +129,7 @@ SERVICE *service; service->credentials.name = NULL; service->credentials.authdata = NULL; service->enable_root = 0; - service->localhost_match_any = 0; + service->localhost_match_wildcard_host = 0; service->routerOptions = NULL; service->databases = NULL; service->svc_config_param = NULL; diff --git a/server/modules/protocol/mysql_client.c b/server/modules/protocol/mysql_client.c index 3c8a70bd9..c106ac420 100644 --- a/server/modules/protocol/mysql_client.c +++ b/server/modules/protocol/mysql_client.c @@ -42,6 +42,7 @@ #include #include #include +#include MODULE_INFO info = { MODULE_API_PROTOCOL, diff --git a/server/modules/protocol/mysql_common.c b/server/modules/protocol/mysql_common.c index 45d93023a..116c3c948 100644 --- a/server/modules/protocol/mysql_common.c +++ b/server/modules/protocol/mysql_common.c @@ -1352,10 +1352,10 @@ int gw_find_mysql_user_password_sha1(char *username, uint8_t *gateway_password, if ((key.ipv4.sin_addr.s_addr == 0x0100007F) && !dcb->service->localhost_match_wildcard_host) { /* Skip the wildcard check and return 1 */ - LOGIF(LD, + LOGIF(LE, (skygw_log_write_flush( - LOGFILE_DEBUG, - "%lu [MySQL Client Auth], user [%s@%s] not existent", + LOGFILE_ERROR, + "%lu [MySQL Client Auth], user [%s@%s] not found, try with 'localhost_match_wildcard_host=1' in service definition", pthread_self(), key.user, dcb->remote))); @@ -1699,8 +1699,6 @@ void protocol_add_srv_command( MySQLProtocol* p, mysql_server_cmd_t cmd) { - server_command_t* c; - spinlock_acquire(&p->protocol_lock); if (p->protocol_state != MYSQL_PROTOCOL_ACTIVE)