summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-12-12 13:18:46 +0100
committerSergei Golubchik <serg@mariadb.org>2023-01-02 00:04:03 +0100
commitca23558a0561856cc7f3c1ab5db4025102482380 (patch)
tree51065e23f5ad0b459c87171fa649c58ccd49af4a /sql/sql_acl.cc
parentd78ac04ee609b0b63bb688be2a837a6ca7670392 (diff)
downloadmariadb-git-ca23558a0561856cc7f3c1ab5db4025102482380.tar.gz
--skip-name-resolve=0 didn't work
custom code in `case OPT_SKIP_RESOLVE` was overriding the correct value from handle_options().
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index f4a3ab14f57..7a01da3fa76 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -315,9 +315,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)))
{
@@ -1781,7 +1781,6 @@ static bool set_user_plugin (ACL_USER *user, size_t password_len)
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];
int password_length;
Sql_mode_save old_mode_save(thd);
@@ -1825,7 +1824,7 @@ 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_sort(2, 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.",
@@ -1929,7 +1928,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
continue;
}
- if (!is_role && check_no_resolve &&
+ if (!is_role && opt_skip_name_resolve &&
hostname_requires_resolving(user.host.hostname))
{
sql_print_warning("'user' entry '%s@%s' "
@@ -2105,7 +2104,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.",
@@ -2160,7 +2159,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);
@@ -7348,7 +7347,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");
@@ -7392,7 +7390,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))
{
@@ -7437,7 +7435,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))
{