Merge branch 'develop' into 1.2.1-binlog_router_trx

This commit is contained in:
MassimilianoPinto
2015-08-26 11:46:02 +02:00
6 changed files with 12 additions and 10 deletions

View File

@ -109,7 +109,7 @@ EXTERNCMD* externcmd_allocate(char* argstr)
if(access(cmd->parameters[0],X_OK) != 0) if(access(cmd->parameters[0],X_OK) != 0)
{ {
skygw_log_write(LE, skygw_log_write(LE,
"Error: Cannot execute file: %s", "Error: Cannot execute file '%s'. Missing execution permissions.",
cmd->parameters[0]); cmd->parameters[0]);
externcmd_free(cmd); externcmd_free(cmd);
return NULL; return NULL;

View File

@ -242,11 +242,11 @@ GWPROTOCOL *funcs;
{ {
/* Try loading authentication data from file cache */ /* Try loading authentication data from file cache */
char *ptr, path[4097]; char *ptr, path[PATH_MAX+1];
strcpy(path, get_cachedir()); strncpy(path, get_cachedir(),sizeof(path)-1);
strncat(path, "/", 4096); strncat(path, "/", sizeof(path)-1);
strncat(path, service->name, 4096); strncat(path, service->name, sizeof(path)-1);
strncat(path, "/.cache/dbusers", 4096); strncat(path, "/.cache/dbusers", sizeof(path)-1);
loaded = dbusers_load(service->users, path); loaded = dbusers_load(service->users, path);
if (loaded != -1) if (loaded != -1)
{ {

View File

@ -40,6 +40,7 @@
#include <housekeeper.h> #include <housekeeper.h>
#include <buffer.h> #include <buffer.h>
#include <regex.h> #include <regex.h>
#include <modules.h>
static char* server_options[] = { static char* server_options[] = {
"MariaDB Corporation MaxScale", "MariaDB Corporation MaxScale",

View File

@ -239,7 +239,7 @@ void mon_append_node_names(MONITOR_SERVERS* start,char* str, int len)
} }
first = false; first = false;
sprintf(arr,"%s:%d",ptr->server->name,ptr->server->port); sprintf(arr,"%s:%d",ptr->server->name,ptr->server->port);
strcat(str,arr); strncat(str,arr,len);
ptr = ptr->next; ptr = ptr->next;
slen = strlen(str); slen = strlen(str);
} }
@ -306,10 +306,10 @@ void monitor_launch_script(MONITOR* mon,MONITOR_SERVERS* ptr, char* script)
ptr->server->name, ptr->server->name,
ptr->server->port); ptr->server->port);
mon_append_node_names(mon->databases,argstr,PATH_MAX + MON_ARG_MAX + 1); mon_append_node_names(mon->databases,argstr,PATH_MAX + MON_ARG_MAX);
if((cmd = externcmd_allocate(argstr)) == NULL) if((cmd = externcmd_allocate(argstr)) == NULL)
{ {
skygw_log_write(LE,"Failed to execute script: %s",script); skygw_log_write(LE,"Failed to initialize script: %s",script);
return; return;
} }

View File

@ -1441,7 +1441,8 @@ static route_target_t get_route_target (
{ {
target = TARGET_SLAVE; target = TARGET_SLAVE;
} }
else if (QUERY_IS_TYPE(qtype, QUERY_TYPE_MASTER_READ) ||
if (QUERY_IS_TYPE(qtype, QUERY_TYPE_MASTER_READ) ||
QUERY_IS_TYPE(qtype, QUERY_TYPE_EXEC_STMT) || QUERY_IS_TYPE(qtype, QUERY_TYPE_EXEC_STMT) ||
/** Configured not to allow reading variables from slaves */ /** Configured not to allow reading variables from slaves */
(use_sql_variables_in == TYPE_MASTER && (use_sql_variables_in == TYPE_MASTER &&