fix unix socket connection denied by ob_tcp_invited_node

This commit is contained in:
zhjc1124
2023-08-09 04:42:53 +00:00
committed by ob-robot
parent 7d8c1d5a7f
commit 581225e5a0
3 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class ObBatchP;
namespace common namespace common
{ {
class ObString; class ObString;
static constexpr char UNIX_SOCKET_CLIENT_IP[] = "unix:";
class ObAddr class ObAddr
{ {
OB_UNIS_VERSION(1); OB_UNIS_VERSION(1);

View File

@ -1894,6 +1894,8 @@ int ObMPConnect::verify_ip_white_list(const uint64_t tenant_id) const
if (OB_UNLIKELY(client_ip_.empty())) { if (OB_UNLIKELY(client_ip_.empty())) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("client_ip is empty", K(ret)); LOG_WARN("client_ip is empty", K(ret));
} else if (0 == client_ip_.compare(UNIX_SOCKET_CLIENT_IP)) {
LOG_INFO("match unix socket connection", K(tenant_id), K(client_ip_));
} else if (OB_FAIL(gctx_.schema_service_->get_tenant_schema_guard(tenant_id, schema_guard))) { } else if (OB_FAIL(gctx_.schema_service_->get_tenant_schema_guard(tenant_id, schema_guard))) {
LOG_WARN("get_schema_guard failed", K(ret)); LOG_WARN("get_schema_guard failed", K(ret));
} else if (OB_FAIL(schema_guard.get_tenant_info(tenant_id, tenant_schema))) { } else if (OB_FAIL(schema_guard.get_tenant_info(tenant_id, tenant_schema))) {

View File

@ -275,7 +275,7 @@ int ObVariableSetExecutor::execute(ObExecContext &ctx, ObVariableSetStmt &stmt)
if (!addr.ip_to_string(buf, sizeof(buf))) { if (!addr.ip_to_string(buf, sizeof(buf))) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("format leader ip failed", K(ret), K(addr)); LOG_WARN("format leader ip failed", K(ret), K(addr));
} else if (!(0 == client_ip.compare("unix:"))) { } else if (!(0 == client_ip.compare(UNIX_SOCKET_CLIENT_IP))) {
ret = OB_NOT_SUPPORTED; ret = OB_NOT_SUPPORTED;
LOG_WARN("modify SECURE_FILE_PRIV not by unix socket connection", K(ret), K(client_ip)); LOG_WARN("modify SECURE_FILE_PRIV not by unix socket connection", K(ret), K(client_ip));
LOG_USER_ERROR(OB_NOT_SUPPORTED, "modify SECURE_FILE_PRIV not by unix socket connection"); LOG_USER_ERROR(OB_NOT_SUPPORTED, "modify SECURE_FILE_PRIV not by unix socket connection");