summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-06-28 17:59:41 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-06-28 17:59:41 -0300
commitbfd3b7a109f567ebbbe0f17a6a804c3d42285a89 (patch)
tree1496d4c5a961584fa7eb53f2e3bb14728c515594 /sql/sql_acl.cc
parent407b68bf99bbd4321e675259335f9266f0f5fe49 (diff)
downloadmariadb-git-bfd3b7a109f567ebbbe0f17a6a804c3d42285a89.tar.gz
Revert Bug#48321 due to build breakage and failing tests.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc23
1 files changed, 6 insertions, 17 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index acf14fc91c4..dd256c70ecb 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -194,7 +194,6 @@ static bool compare_hostname(const acl_host_and_ip *host,const char *hostname,
const char *ip);
static my_bool acl_load(THD *thd, TABLE_LIST *tables);
static my_bool grant_load(THD *thd, TABLE_LIST *tables);
-static inline void get_grantor(THD *thd, char* grantor);
/*
Convert scrambled password to binary form, according to scramble type,
@@ -2705,20 +2704,6 @@ end:
DBUG_RETURN(result);
}
-static inline void get_grantor(THD *thd, char *grantor)
-{
- const char *user= thd->security_ctx->user;
- const char *host= thd->security_ctx->host_or_ip;
-
-#if defined(HAVE_REPLICATION)
- if (thd->slave_thread && thd->variables.current_user.user.length > 0)
- {
- user= thd->variables.current_user.user.str;
- host= thd->variables.current_user.host.str;
- }
-#endif
- strxmov(grantor, user, "@", host, NullS);
-}
static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
TABLE *table, const LEX_USER &combo,
@@ -2733,7 +2718,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
uchar user_key[MAX_KEY_LENGTH];
DBUG_ENTER("replace_table_table");
- get_grantor(thd, grantor);
+ strxmov(grantor, thd->security_ctx->user, "@",
+ thd->security_ctx->host_or_ip, NullS);
+
/*
The following should always succeed as new users are created before
this function is called!
@@ -2863,7 +2850,9 @@ static int replace_routine_table(THD *thd, GRANT_NAME *grant_name,
DBUG_RETURN(-1);
}
- get_grantor(thd, grantor);
+ strxmov(grantor, thd->security_ctx->user, "@",
+ thd->security_ctx->host_or_ip, NullS);
+
/*
New users are created before this function is called.