Commit 3fe752f5 authored by unknown's avatar unknown
Browse files

WL#2787 (Add view definer/owner to the view definition (.frm) to check...

WL#2787 (Add view definer/owner to the view definition (.frm) to check privileges on used tables and stored routines when using a VIEW.)
Part 2 postreview fixes.


sql/ha_innodb.cc:
  Renamed structure st_security_context to class Security_context
sql/item_func.cc:
  Renamed structure st_security_context to class Security_context
sql/item_strfunc.cc:
  fixed USER() function
sql/log.cc:
  variable used to optimize access to security context
sql/mysql_priv.h:
  Renamed structure st_security_context to class Security_context
sql/mysqld.cc:
  main security context used direcly
sql/sp_head.cc:
  Renamed structure st_security_context to class Security_context
  removed unneed variable
sql/sp_head.h:
  Comment inmroved
  Renamed structure st_security_context to class Security_context
sql/sql_acl.cc:
  Renamed structure st_security_context to class Security_context
  fixed function comment and return value
  variable used to optimize access to security context
  Renamed method of Security_ontext
sql/sql_acl.h:
  fixed return value type
sql/sql_class.cc:
  Renamed structure st_security_context to class Security_context
sql/sql_class.h:
  Renamed structure st_security_context to class Security_context
  Method renamed
sql/sql_db.cc:
  Renamed structure st_security_context to class Security_context
  fixed layout
sql/sql_parse.cc:
  registration of wanted access for underlying tables
sql/sql_show.cc:
  Renamed structure st_security_context to class Security_context
  fixed layout
sql/sql_yacc.yy:
  Renamed structure st_security_context to class Security_context
parent 84f029a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -563,7 +563,7 @@ innobase_mysql_print_thd(
				   use the default max length */
{
	const THD*	thd;
        const st_security_context *sctx;
        const Security_context *sctx;
	const char*	s;

        thd = (const THD*) input_thd;
+1 −1
Original line number Diff line number Diff line
@@ -4713,7 +4713,7 @@ Item_func_sp::execute(Item **itp)
  Sub_statement_state statement_state;

#ifndef NO_EMBEDDED_ACCESS_CHECKS
  st_security_context *save_ctx;
  Security_context *save_ctx;
#endif

  if (! m_sp && ! (m_sp= sp_find_function(thd, m_name, TRUE)))
+1 −1
Original line number Diff line number Diff line
@@ -1608,7 +1608,7 @@ String *Item_func_user::val_str(String *str)
  else
  {
    user= thd->main_security_ctx.user;
    host= thd->main_security_ctx.priv_host;
    host= thd->main_security_ctx.host;
  }

  // For system threads (e.g. replication SQL thread) user may be empty
+6 −5
Original line number Diff line number Diff line
@@ -1915,6 +1915,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
    }
    if (!(specialflag & SPECIAL_SHORT_LOG_FORMAT) || query_start_arg)
    {
      Security_context *sctx= thd->security_ctx;
      current_time=time(NULL);
      if (current_time != last_time)
      {
@@ -1935,11 +1936,11 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
          tmp_errno=errno;
      }
      if (my_b_printf(&log_file, "# User@Host: %s[%s] @ %s [%s]\n",
                      thd->security_ctx->priv_user ?
                      thd->security_ctx->priv_user : "",
                      thd->security_ctx->user ? thd->security_ctx->user : "",
                      thd->security_ctx->host ? thd->security_ctx->host : "",
                      thd->security_ctx->ip ? thd->security_ctx->ip : "") ==
                      sctx->priv_user ?
                      sctx->priv_user : "",
                      sctx->user ? sctx->user : "",
                      sctx->host ? sctx->host : "",
                      sctx->ip ? sctx->ip : "") ==
          (uint) -1)
        tmp_errno=errno;
    }
+2 −2
Original line number Diff line number Diff line
@@ -484,7 +484,7 @@ typedef my_bool (*qc_engine_callback)(THD *thd, char *table_key,
#include "protocol.h"
#include "sql_udf.h"
class user_var_entry;
class st_security_context;
class Security_context;
enum enum_var_type
{
  OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL
@@ -516,7 +516,7 @@ bool delete_precheck(THD *thd, TABLE_LIST *tables);
bool insert_precheck(THD *thd, TABLE_LIST *tables);
bool create_table_precheck(THD *thd, TABLE_LIST *tables,
                           TABLE_LIST *create_table);
bool default_view_definer(st_security_context *sctx, st_lex_user *definer);
bool default_view_definer(Security_context *sctx, st_lex_user *definer);


enum enum_mysql_completiontype {
Loading