diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-06-28 19:18:22 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-06-28 19:18:22 -0300 |
commit | 3a57c8d1d98b875bb09f81afcc38d4a4c14327d0 (patch) | |
tree | b9e182c75ad72c35c0a5efdc3168a87174beba66 /sql/sql_acl.cc | |
parent | 73994755791497aeff01e64bf075ab254fe4b221 (diff) | |
parent | bfd3b7a109f567ebbbe0f17a6a804c3d42285a89 (diff) | |
download | mariadb-git-3a57c8d1d98b875bb09f81afcc38d4a4c14327d0.tar.gz |
Merge of mysql-5.1-bugteam into mysql-trunk-merge.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 83ee1b8be75..ec25e4cb68b 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -210,7 +210,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, @@ -2756,20 +2755,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, @@ -2784,7 +2769,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! @@ -2914,7 +2901,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. |