summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-01-03 16:10:02 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2023-01-03 16:10:02 +0200
commitfb0808c450849e00993fa38839f33969a9daf7e8 (patch)
tree55aca4c3c7dff7e09a13efa6dcfb58d5e91def35 /sql/sql_acl.cc
parentfb41117c907a99d051ac09c229762978373d7eb0 (diff)
parent8760f6907c51e0e20242a53188be5b62029d6f1a (diff)
downloadmariadb-git-fb0808c450849e00993fa38839f33969a9daf7e8.tar.gz
Merge 10.3 into 10.4
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))
{