Merge branch '2.3' into develop
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
#include "envv.h"
|
#include "envv.h"
|
||||||
|
|
||||||
@ -189,8 +190,14 @@ int Nodes::ssh_node(int node, const char* ssh, bool sudo)
|
|||||||
{
|
{
|
||||||
return WEXITSTATUS(rc);
|
return WEXITSTATUS(rc);
|
||||||
}
|
}
|
||||||
|
else if (WIFSIGNALED(rc) && WTERMSIG(rc) == SIGHUP)
|
||||||
|
{
|
||||||
|
// SIGHUP appears to happen for SSH connections
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
std::cout << strerror(errno) << std::endl;
|
||||||
return 256;
|
return 256;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -816,23 +816,28 @@ static bool check_default_table_permissions(MYSQL* mysql,
|
|||||||
"Database name will be ignored in authentication. ");
|
"Database name will be ignored in authentication. ");
|
||||||
|
|
||||||
// Check whether the current user has the SHOW DATABASES privilege
|
// Check whether the current user has the SHOW DATABASES privilege
|
||||||
if (mxs_mysql_query(mysql,
|
if (mxs_mysql_query(mysql, "SHOW GRANTS") == 0)
|
||||||
"SELECT show_db_priv FROM mysql.user "
|
|
||||||
"WHERE CONCAT(user, '@', host) = CURRENT_USER()") == 0)
|
|
||||||
{
|
{
|
||||||
MYSQL_RES* res = mysql_use_result(mysql);
|
if (MYSQL_RES* res = mysql_use_result(mysql))
|
||||||
if (res)
|
|
||||||
{
|
{
|
||||||
MYSQL_ROW row = mysql_fetch_row(res);
|
bool found = false;
|
||||||
|
|
||||||
if (row && strcasecmp(row[0], "Y") != 0)
|
for (MYSQL_ROW row = mysql_fetch_row(res); row; row = mysql_fetch_row(res))
|
||||||
|
{
|
||||||
|
if (strcasestr(row[0], "SHOW DATABASES"))
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found)
|
||||||
{
|
{
|
||||||
MXS_WARNING("[%s] User '%s' is missing the SHOW DATABASES privilege. "
|
MXS_WARNING("[%s] User '%s' is missing the SHOW DATABASES privilege. "
|
||||||
"This means that MaxScale cannot see all databases and authentication can fail.",
|
"This means that MaxScale cannot see all databases and authentication can fail.",
|
||||||
service->name(),
|
service->name(),
|
||||||
user);
|
user);
|
||||||
}
|
}
|
||||||
|
|
||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user