summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/Makefile.am6
-rw-r--r--libmysqld/lib_sql.cc28
2 files changed, 17 insertions, 17 deletions
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 01fbbc0f7d9..691bf0cd99f 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -37,7 +37,7 @@ SUBDIRS = . examples
libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
my_time.c
-sqlexamplessources = ha_example.cc ha_archive.cc ha_tina.cc
+sqlexamplessources = ha_example.cc ha_tina.cc
noinst_HEADERS = embedded_priv.h emb_qcache.h
@@ -60,10 +60,10 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
- spatial.cc gstream.cc sql_help.cc tztime.cc protocol_cursor.cc \
+ spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
- ha_blackhole.cc
+ ha_blackhole.cc ha_archive.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
libmysqld_a_SOURCES=
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index a86d467299c..8552b1c2b8a 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -423,9 +423,9 @@ int init_embedded_server(int argc, char **argv, char **groups)
acl_error= 0;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (!(acl_error= acl_init((THD *)0, opt_noacl)) &&
+ if (!(acl_error= acl_init(opt_noacl)) &&
!opt_noacl)
- (void) grant_init((THD *)0);
+ (void) grant_init();
#endif
if (acl_error || my_tz_init((THD *)0, default_tz_name, opt_bootstrap))
{
@@ -514,8 +514,8 @@ void *create_embedded_thd(int client_flag, char *db)
thd->db= db;
thd->db_length= db ? strip_sp(db) : 0;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- thd->db_access= DB_ACLS;
- thd->master_access= ~NO_ACCESS;
+ thd->security_ctx->db_access= DB_ACLS;
+ thd->security_ctx->master_access= ~NO_ACCESS;
#endif
thd->net.query_cache_query= 0;
@@ -532,10 +532,9 @@ err:
int check_embedded_connection(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
- thd->host= (char*)my_localhost;
- thd->host_or_ip= thd->host;
- thd->user= my_strdup(mysql->user, MYF(0));
- thd->priv_user= thd->user;
+ Security_context *sctx= thd->security_ctx;
+ sctx->host_or_ip= sctx->host= (char*)my_localhost;
+ sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0));
return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true);
}
@@ -543,26 +542,27 @@ int check_embedded_connection(MYSQL *mysql)
int check_embedded_connection(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
+ Security_context *sctx= thd->security_ctx;
int result;
char scramble_buff[SCRAMBLE_LENGTH];
int passwd_len;
if (mysql->options.client_ip)
{
- thd->host= my_strdup(mysql->options.client_ip, MYF(0));
- thd->ip= my_strdup(thd->host, MYF(0));
+ sctx->host= my_strdup(mysql->options.client_ip, MYF(0));
+ sctx->ip= my_strdup(sctx->host, MYF(0));
}
else
- thd->host= (char*)my_localhost;
- thd->host_or_ip= thd->host;
+ sctx->host= (char*)my_localhost;
+ sctx->host_or_ip= sctx->host;
- if (acl_check_host(thd->host,thd->ip))
+ if (acl_check_host(sctx->host, sctx->ip))
{
result= ER_HOST_NOT_PRIVILEGED;
goto err;
}
- thd->user= my_strdup(mysql->user, MYF(0));
+ sctx->user= my_strdup(mysql->user, MYF(0));
if (mysql->passwd && mysql->passwd[0])
{
memset(thd->scramble, 55, SCRAMBLE_LENGTH); // dummy scramble