summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorAshish Agarwal <ashish.y.agarwal@oracle.com>2013-08-23 09:07:09 +0530
committerAshish Agarwal <ashish.y.agarwal@oracle.com>2013-08-23 09:07:09 +0530
commitd75c58e11fb864abafb48d74efd9bb1dbdc9f4c4 (patch)
tree01a2e2f69168201021668f8d6144a6aa701c61ad /libmysqld
parentf7e0cc8204ab2e9e09e96e77f015dfb369553de0 (diff)
parentf5b5e6b951eabe6d6add84fa915d305a4a95cddf (diff)
downloadmariadb-git-d75c58e11fb864abafb48d74efd9bb1dbdc9f4c4.tar.gz
WL#7076: Backporting wl6715 to support both formats
in 5.5, 5.6, 5.7.
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 2de7217f10b..70cbe6080d7 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -699,7 +699,8 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
thd_init_client_charset(thd, mysql->charset->number);
thd->update_charset();
Security_context *sctx= thd->security_ctx;
- sctx->host_or_ip= sctx->host= (char*) my_localhost;
+ sctx->set_host(my_localhost);
+ sctx->host_or_ip= sctx->get_host()->ptr();
strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
strmake(sctx->priv_user, mysql->user, USERNAME_LENGTH-1);
sctx->user= my_strdup(mysql->user, MYF(0));
@@ -727,14 +728,14 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
if (mysql->options.client_ip)
{
- sctx->host= my_strdup(mysql->options.client_ip, MYF(0));
- sctx->ip= my_strdup(sctx->host, MYF(0));
+ sctx->set_host(my_strdup(mysql->options.client_ip, MYF(0)));
+ sctx->set_ip(my_strdup(sctx->get_host()->ptr(), MYF(0)));
}
else
- sctx->host= (char*)my_localhost;
- sctx->host_or_ip= sctx->host;
+ sctx->set_host((char*)my_localhost);
+ sctx->host_or_ip= sctx->host->ptr();
- if (acl_check_host(sctx->host, sctx->ip))
+ if (acl_check_host(sctx->get_host()->ptr(), sctx->get_ip()->ptr()))
goto err;
/* construct a COM_CHANGE_USER packet */