Merge branch 'develop' into 1.2.1-binlog_router_trx

This commit is contained in:
MassimilianoPinto 2015-08-28 16:42:15 +02:00
commit 55248ec60e
3 changed files with 17 additions and 13 deletions

View File

@ -898,7 +898,7 @@ process_config_context(CONFIG_CONTEXT *context)
s = strtok_r(NULL, ",", &lasts);
}
}
else if (servers == NULL && !isInternalService(router))
else if (servers == NULL && !isInternalService(router) && strcmp(router,"binlogrouter"))
{
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,

View File

@ -2406,15 +2406,21 @@ bool check_service_permissions(SERVICE* service)
if(mysql_real_connect(mysql,server->server->name,user,dpasswd,NULL,server->server->port,NULL,0) == NULL)
{
int my_errno = mysql_errno(mysql);
skygw_log_write(LE,"%s: Error: Failed to connect to server %s(%s:%d) when"
" checking authentication user credentials and permissions.",
" checking authentication user credentials and permissions: %d %s",
service->name,
server->server->unique_name,
server->server->name,
server->server->port);
server->server->port,
my_errno,
mysql_error(mysql));
mysql_close(mysql);
free(dpasswd);
return false;
/** We don't know enough about user permissions */
return my_errno != ER_ACCESS_DENIED_ERROR;
}
if(mysql_query(mysql,"SELECT user, host, password,Select_priv FROM mysql.user limit 1") != 0)
@ -2424,6 +2430,7 @@ bool check_service_permissions(SERVICE* service)
skygw_log_write(LE,"%s: Error: User '%s' is missing SELECT privileges"
" on mysql.user table. MySQL error message: %s",
service->name,user,mysql_error(mysql));
rval = false;
}
else
{
@ -2431,7 +2438,6 @@ bool check_service_permissions(SERVICE* service)
" MySQL error message: %s",
service->name,mysql_error(mysql));
}
rval = false;
}
else
{
@ -2442,9 +2448,8 @@ bool check_service_permissions(SERVICE* service)
service->name,mysql_error(mysql));
mysql_close(mysql);
free(dpasswd);
return false;
return true;
}
mysql_free_result(res);
}
if(mysql_query(mysql,"SELECT user, host, db FROM mysql.db limit 1") != 0)
@ -2453,13 +2458,13 @@ bool check_service_permissions(SERVICE* service)
{
skygw_log_write(LE,"%s: Error: User '%s' is missing SELECT privileges on mysql.db table. MySQL error message: %s",
service->name,user,mysql_error(mysql));
rval = false;
}
else
{
skygw_log_write(LE,"%s: Error: Failed to query from mysql.db table. MySQL error message: %s",
service->name,mysql_error(mysql));
}
rval = false;
}
else
{
@ -2467,7 +2472,6 @@ bool check_service_permissions(SERVICE* service)
{
skygw_log_write(LE,"%s: Error: Result retrieval failed when checking for permissions to the mysql.db table: %s",
service->name,mysql_error(mysql));
rval = false;
}
else
{

View File

@ -235,11 +235,11 @@ GWPROTOCOL *funcs;
{
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Unable to load users from %s:%d for "
"service %s.",
"Error : Unable to load users for "
"service %s listening at %s:%d.",
service->name,
(port->address == NULL ? "0.0.0.0" : port->address),
port->port,
service->name)));
port->port)));
{
/* Try loading authentication data from file cache */