summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-01-03 14:38:27 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2023-01-03 14:38:27 +0200
commitd54510716e3ed1c497eb45338dbc47dfd0c2d0b2 (patch)
tree94a3351755f524f29f7931ba33fbc9438132a82f /sql/sql_acl.cc
parentfb41117c907a99d051ac09c229762978373d7eb0 (diff)
parente51a1d6fc0c105d56c6f05efb3d9fd05b7e4f22f (diff)
downloadmariadb-git-10.4-MDEV-29988-merge.tar.gz
WIP merge 10.3 into 10.410.4-MDEV-29988-merge
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index afb1968c73f..211114f0d19 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
- Copyright (c) 2009, 2022, MariaDB
+ Copyright (c) 2009, 2023, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -373,9 +373,9 @@ public:
update_hostname(&host, safe_strdup_root(mem, host_arg));
}
- bool check_validity(bool check_no_resolve)
+ bool check_validity()
{
- if (check_no_resolve &&
+ if (opt_skip_name_resolve &&
(hostname_requires_resolving(host.hostname) ||
hostname_requires_resolving(proxied_host.hostname)))
{
@@ -2398,7 +2398,6 @@ static void push_new_user(const ACL_USER &user)
static bool acl_load(THD *thd, const Grant_tables& tables)
{
READ_RECORD read_record_info;
- bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
char tmp_name[SAFE_NAME_LEN+1];
Sql_mode_save old_mode_save(thd);
DBUG_ENTER("acl_load");
@@ -2441,7 +2440,8 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
host.access= host_table.get_access();
host.access= fix_rights_for_db(host.access);
host.sort= get_magic_sort("hd", host.host.hostname, host.db);
- if (check_no_resolve && hostname_requires_resolving(host.host.hostname))
+ if (opt_skip_name_resolve &&
+ hostname_requires_resolving(host.host.hostname))
{
sql_print_warning("'host' entry '%s|%s' "
"ignored in --skip-name-resolve mode.",
@@ -2511,7 +2511,8 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
}
else
{
- if (check_no_resolve && hostname_requires_resolving(user.host.hostname))
+ if (opt_skip_name_resolve &&
+ hostname_requires_resolving(user.host.hostname))
{
sql_print_warning("'user' entry '%s@%s' "
"ignored in --skip-name-resolve mode.", user.user.str,
@@ -2569,7 +2570,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
sql_print_warning("Found an entry in the 'db' table with empty database name; Skipped");
continue;
}
- if (check_no_resolve && hostname_requires_resolving(db.host.hostname))
+ if (opt_skip_name_resolve && hostname_requires_resolving(db.host.hostname))
{
sql_print_warning("'db' entry '%s %s@%s' "
"ignored in --skip-name-resolve mode.",
@@ -2624,7 +2625,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
{
ACL_PROXY_USER proxy;
proxy.init(proxies_priv_table, &acl_memroot);
- if (proxy.check_validity(check_no_resolve))
+ if (proxy.check_validity())
continue;
if (push_dynamic(&acl_proxy_users, (uchar*) &proxy))
DBUG_RETURN(TRUE);
@@ -7780,7 +7781,6 @@ static bool grant_load(THD *thd,
{
bool return_val= 1;
TABLE *t_table, *c_table, *p_table;
- bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
MEM_ROOT *save_mem_root= thd->mem_root;
sql_mode_t old_sql_mode= thd->variables.sql_mode;
DBUG_ENTER("grant_load");
@@ -7824,7 +7824,7 @@ static bool grant_load(THD *thd,
goto end_unlock;
}
- if (check_no_resolve)
+ if (opt_skip_name_resolve)
{
if (hostname_requires_resolving(mem_check->host.hostname))
{
@@ -7868,7 +7868,7 @@ static bool grant_load(THD *thd,
goto end_unlock_p;
}
- if (check_no_resolve)
+ if (opt_skip_name_resolve)
{
if (hostname_requires_resolving(mem_check->host.hostname))
{