summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-01-03 18:13:11 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2023-01-03 18:13:11 +0200
commite441c32a0be631c4f39c7337718d1d91ad721b79 (patch)
tree12076e47bed0cc1dc98a0c987e76e6cc6350b6bf /sql/sql_acl.cc
parentfce80b6ae1e909e7ce0959650fe7b4b80a3537fd (diff)
parent8b9b4ab3f59f86e1c8f6cd6a0e6b8916db61933d (diff)
downloadmariadb-git-e441c32a0be631c4f39c7337718d1d91ad721b79.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc25
1 files changed, 12 insertions, 13 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index af76687002b..b6f7daf42c3 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
@@ -383,9 +383,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)))
{
@@ -2526,7 +2526,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");
@@ -2569,7 +2568,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.",
@@ -2640,7 +2640,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,
@@ -2698,7 +2699,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.",
@@ -2753,7 +2754,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);
@@ -7923,7 +7924,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;
DBUG_ENTER("grant_load");
@@ -7970,7 +7970,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))
{
@@ -8014,7 +8014,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))
{
@@ -12079,8 +12079,7 @@ void Sql_cmd_grant::warn_hostname_requires_resolving(THD *thd,
List_iterator <LEX_USER> it(users);
while ((user= it++))
{
- if (specialflag & SPECIAL_NO_RESOLVE &&
- hostname_requires_resolving(user->host.str))
+ if (opt_skip_name_resolve && hostname_requires_resolving(user->host.str))
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WARN_HOSTNAME_WONT_WORK,
ER_THD(thd, ER_WARN_HOSTNAME_WONT_WORK));