Commit 241bb226 authored by unknown's avatar unknown

Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.

Added missing cleanup in sp-security.test.


mysql-test/r/sp-security.result:
  Added clean-up.
mysql-test/t/sp-security.test:
  Added clean-up.
sql/item_func.cc:
  Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
sql/sp_head.cc:
  Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
sql/sp_head.h:
  Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
sql/sql_parse.cc:
  Forgot to wrap things in #ifndef NO_EMBEDDED_ACCESS_CHECKS for the embedded server.
parent 1d77c041
......@@ -39,6 +39,7 @@ call stamp(5);
ERROR 42000: Access denied for user: 'dummy'@'localhost' to database 'db1_secret'
call stamp(6);
ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret'
drop procedure stamp;
use test;
drop database db1_secret;
delete from mysql.user where user='dummy';
......@@ -94,6 +94,7 @@ call stamp(6);
# Clean up
connection con1root;
drop procedure stamp;
use test;
drop database db1_secret;
delete from mysql.user where user='dummy';
......@@ -3069,19 +3069,25 @@ Item_func_sp::execute(Item **itp)
{
DBUG_ENTER("Item_func_sp::execute");
THD *thd= current_thd;
st_sp_security_context save_ctx;
int res;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
st_sp_security_context save_ctx;
#endif
if (! m_sp)
m_sp= sp_find_function(thd, &m_name);
if (! m_sp)
DBUG_RETURN(-1);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
sp_change_security_context(thd, m_sp, &save_ctx);
#endif
res= m_sp->execute_function(thd, args, arg_count, itp);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
sp_restore_security_context(thd, m_sp, &save_ctx);
#endif
DBUG_RETURN(res);
}
......
......@@ -1080,7 +1080,7 @@ sp_instr_cfetch::execute(THD *thd, uint *nextp)
//
// Security context swapping
//
#ifndef NO_EMBEDDED_ACCESS_CHECKS
void
sp_change_security_context(THD *thd, sp_head *sp, st_sp_security_context *ctxp)
{
......@@ -1136,3 +1136,5 @@ sp_restore_security_context(THD *thd, sp_head *sp, st_sp_security_context *ctxp)
strncpy(thd->priv_host, ctxp->priv_host, sizeof(thd->priv_host));
}
}
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
......@@ -649,10 +649,11 @@ struct st_sp_security_context
char *ip;
};
#ifndef NO_EMBEDDED_ACCESS_CHECKS
void
sp_change_security_context(THD *thd, sp_head *sp, st_sp_security_context *ctxp);
void
sp_restore_security_context(THD *thd, sp_head *sp,st_sp_security_context *ctxp);
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
#endif /* _SP_HEAD_H_ */
......@@ -3501,7 +3501,9 @@ mysql_execute_command(THD *thd)
}
else
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
st_sp_security_context save_ctx;
#endif
uint smrx;
LINT_INIT(smrx);
......@@ -3533,11 +3535,15 @@ mysql_execute_command(THD *thd)
thd->server_status |= SERVER_MORE_RESULTS_EXISTS;
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
sp_change_security_context(thd, sp, &save_ctx);
#endif
res= sp->execute_procedure(thd, &lex->value_list);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
sp_restore_security_context(thd, sp, &save_ctx);
#endif
#ifndef EMBEDDED_LIBRARY
thd->net.no_send_ok= nsok;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment