mariadb/mysql-test/r
unknown 06bf59ad33 Bug#18630: Arguments of suid routine calculated in wrong security
context.

Routine arguments were evaluated in the security context of the routine
itself, not in the caller's context.

The bug is fixed the following way:

  - Item_func_sp::find_and_check_access() has been split into two
    functions: Item_func_sp::find_and_check_access() itself only
    finds the function and check that the caller have EXECUTE privilege
    on it.  New function set_routine_security_ctx() changes security
    context for SUID routines and checks that definer have EXECUTE
    privilege too.

  - new function sp_head::execute_trigger() is called from
    Table_triggers_list::process_triggers() instead of
    sp_head::execute_function(), and is effectively just as the
    sp_head::execute_function() is, with all non-trigger related code
    removed, and added trigger-specific security context switch.

  - call to Item_func_sp::find_and_check_access() stays outside
    of sp_head::execute_function(), and there is a code in
    sql_parse.cc before the call to sp_head::execute_procedure() that
    checks that the caller have EXECUTE privilege, but both
    sp_head::execute_function() and sp_head::execute_procedure() call
    set_routine_security_ctx() after evaluating their parameters,
    and restore the context after the body is executed.


mysql-test/r/sp-security.result:
  Add test case for bug#18630: Arguments of suid routine calculated
  in wrong security context.
mysql-test/t/sp-security.test:
  Add result for bug#18630: Arguments of suid routine calculated
  in wrong security context.
sql/item_func.cc:
  Do not change security context before executing the function, as it
  will be changed after argument evaluation.
  Do not change security context in Item_func_sp::find_and_check_access().
sql/item_func.h:
  Change prototype for Item_func_sp::find_and_check_access().
sql/sp_head.cc:
  Add set_routine_security_ctx() function.
  Add sp_head::execute_trigger() method.
  Change security context in sp_head::execute_trigger(), and in
  sp_head::execute_function() and sp_head::execute_procedure()
  after argument evaluation.
  Move pop_all_cursors() call to sp_head::execute().
sql/sp_head.h:
  Add declaration for sp_head::execute_trigger() and
  set_routine_security_ctx().
sql/sql_parse.cc:
  Do not change security context before executing the procedure, as it
  will be changed after argument evaluation.
sql/sql_trigger.cc:
  Call new sp_head::execute_trigger() instead of
  sp_head::execute_function(), which is responsible to switch
  security context.
2006-07-13 17:12:31 +04:00
..
alias.result
alter_table.result
analyse.result
analyze.result
ansi.result
archive.result
archive_gis.result
auto_increment.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
backup.result
bdb-alter-table-1.result
bdb-alter-table-2.result
bdb-crash.result
bdb-deadlock.result
bdb.result Fix compilation failures on Windows caused by the patch for Bug#17199. 2006-06-27 14:56:24 +04:00
bdb_cache.result
bdb_gis.result
bench_count_distinct.result
big_test.require
bigint.result
binary.result
binlog.result
blackhole.result
bool.result
bulk_replace.result
case.result
cast.result
check.result
check_var_limit.require
client_xml.result
comments.result
compare.result
compress.result
connect.result
consistent_snapshot.result
constraints.result
count_distinct.result
count_distinct2.result
count_distinct3.result
create.result A fix and a test case for 2006-06-27 00:47:52 +04:00
create_not_windows.result
create_select_tmp.result
csv.result
ctype_big5.result
ctype_collate.result
ctype_cp932.result
ctype_cp932_binlog.result
ctype_cp932_notembedded.result
ctype_cp1250_ch.result
ctype_cp1251.result
ctype_create.result
ctype_eucjpms.result
ctype_euckr.result
ctype_gb2312.result
ctype_gbk.result
ctype_latin1.result
ctype_latin1_de.result
ctype_latin2.result
ctype_latin2_ch.result
ctype_many.result
ctype_mb.result
ctype_recoding.result
ctype_sjis.result
ctype_tis620.result
ctype_uca.result
ctype_ucs.result
ctype_ucs2_def.result Bug#15276: MySQL ignores collation-server 2006-06-23 18:00:49 +05:00
ctype_ucs_binlog.result
ctype_ujis.result
ctype_utf8.result Fixed bug #14896. 2006-06-22 00:29:04 +04:00
date_formats.result
default.result
delayed.result
delete.result
derived.result
dirty_close.result
distinct.result
drop.result
drop_temp_table.result
empty_table.result
endspace.result
errors.result
exampledb.result
explain.result
federated.result Fix test files to work with non-standard ports (MTR_BUILD_THREAD). 2006-06-29 10:35:16 +02:00
federated_archive.result
federated_bug_13118.result
flush.result
flush_block_commit.result
flush_read_lock_kill.result
flush_table.result
foreign_key.result
fulltext.result
fulltext2.result
fulltext_cache.result
fulltext_distinct.result
fulltext_left_join.result
fulltext_multi.result
fulltext_order_by.result
fulltext_update.result
fulltext_var.result
func_compress.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
func_concat.result
func_crypt.result
func_date_add.result
func_default.result
func_des_encrypt.result
func_encrypt.result
func_encrypt_nossl.result
func_equal.result
func_gconcat.result
func_group.result
func_if.result
func_in.result
func_isnull.result
func_like.result
func_math.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
func_misc.result
func_op.result
func_regexp.result
func_sapdb.result Merge mysql.com:/opt/local/work/tmp_merge 2006-06-29 18:34:49 +04:00
func_set.result
func_str.result
func_system.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
func_test.result
func_time.result Merge mysql.com:/opt/local/work/tmp_merge 2006-06-29 18:34:49 +04:00
func_timestamp.result #19409: Test 'func_timestamp' fails on Windows x64 2006-06-22 20:50:38 +02:00
gcc296.result
gis-rtree.result
gis.result merging fix 2006-06-27 17:00:24 +05:00
grant.result
grant2.result
grant3.result
grant_cache.result
greedy_optimizer.result
group_by.result
group_min_max.result
handler.result
have_archive.require
have_bdb.require
have_big5.require
have_blackhole.require
have_compress.require
have_cp932.require
have_cp1250_ch.require
have_crypt.require
have_csv.require
have_debug.require
have_eucjpms.require
have_euckr.require
have_exampledb.require
have_federated_db.require
have_gb2312.require
have_gbk.require
have_geometry.require
have_innodb.require
have_latin2_ch.require
have_met_timezone.require
have_moscow_leap_timezone.require
have_ndb.require
have_ndb_status_ok.require
have_openssl.require
have_outfile.require
have_query_cache.require
have_raid.require
have_sjis.require
have_symlink.require
have_tis620.require
have_ucs2.require
have_udf.require
have_udf_example.require
have_ujis.require
having.result
heap.result
heap_auto_increment.result
heap_btree.result
heap_hash.result
help.result
im_daemon_life_cycle.result
im_life_cycle.result
im_options_set.result
im_options_unset.result
im_utils.result
index_merge.result
index_merge_bdb.result
index_merge_innodb.result
index_merge_innodb2.result
index_merge_ror.result
index_merge_ror_cpk.result
information_schema.result Bug#20230: routine_definition is not null 2006-06-30 00:21:55 +04:00
information_schema_chmod.result
information_schema_db.result
information_schema_inno.result
init_connect.result
init_file.result
innodb-big.result
innodb-deadlock.result
innodb-lock.result
innodb-replace.result
innodb.result
innodb_cache.result
innodb_gis.result
innodb_handler.result
innodb_mysql.result
innodb_notembedded.result
innodb_unsafe_binlog.result
insert.result
insert_select-binlog.result
insert_select.result merge of the changes for bug #18080 2006-06-21 13:03:06 +03:00
insert_update.result
is_debug_build.require
isam.result
join.result
join_crash.result
join_nested.result
join_outer.result
key.result key.result: 2006-06-23 19:36:54 +04:00
key_cache.result
key_diff.result
key_primary.result
keywords.result
kill.result
limit.result
loaddata.result
lock.result
lock_multi.result Bug#16986 - Deadlock condition with MyISAM tables 2006-06-26 19:14:35 +02:00
lock_tables_lost_commit.result
lowercase0.require
lowercase2.require
lowercase_table.result
lowercase_table2.result
lowercase_table3.result
lowercase_table_grant.result
lowercase_table_qcache.result
lowercase_view.result
merge.result
metadata.result
mix_innodb_myisam_binlog.result
multi_statement.result
multi_update.result
myisam-blob.result
myisam.result Merge may.pils.ru:/home/svoj/devel/mysql/BUG20357/mysql-4.1 2006-06-21 19:41:09 +05:00
mysql.result
mysql_client_test.result
mysql_protocols.result
mysqlbinlog.result
mysqlbinlog2.result
mysqlcheck.result
mysqldump-max.result
mysqldump.result Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint 2006-06-26 16:15:41 +02:00
mysqlshow.result
mysqltest.result
ndb_alter_table.result
ndb_alter_table2.result
ndb_autodiscover.result
ndb_autodiscover2.result
ndb_autodiscover3.result
ndb_basic.result
ndb_bitfield.result
ndb_blob.result
ndb_cache.result
ndb_cache2.result
ndb_cache_multi.result
ndb_cache_multi2.result
ndb_charset.result
ndb_condition_pushdown.result
ndb_config.result
ndb_database.result
ndb_default_cluster.require
ndb_gis.result
ndb_grant.result
ndb_index.result
ndb_index_ordered.result
ndb_index_unique.result
ndb_insert.result
ndb_limit.result
ndb_load.result
ndb_loaddatalocal.result
ndb_lock.result
ndb_minmax.result
ndb_multi.result
ndb_read_multi_range.result
ndb_rename.result
ndb_replace.result Fix for Bug #19906 REPLACE doesn't update TEXT fields correctly 2006-06-21 09:36:50 +02:00
ndb_restore.result
ndb_subquery.result
ndb_transaction.result
ndb_truncate.result
ndb_types.result
ndb_update.result
negation_elimination.result
not_as_root.require
not_embedded.require
not_embedded_server.result
not_openssl.require
null.result
null_key.result
odbc.result
olap.result
openssl_1.result
openssl_2.result
order_by.result
order_fill_sortbuf.result
outfile.result
overflow.result
packet.result
preload.result
ps.result A fix and a test case for 2006-06-27 00:47:52 +04:00
ps_1general.result
ps_2myisam.result
ps_3innodb.result
ps_4heap.result
ps_5merge.result
ps_6bdb.result
ps_7ndb.result
ps_10nestset.result
ps_11bugs.result
ps_grant.result
query_cache.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
query_cache_merge.result
query_cache_notembedded.result
raid.result
range.result
read_only.result
rename.result
repair.result
replace.result
rollback.result
row.result
rowid_order_bdb.result
rowid_order_innodb.result
rpl000001.a.result
rpl000001.b.result
rpl000001.result
rpl000002.result
rpl000004.a.result
rpl000004.b.result
rpl000004.result
rpl000005.result
rpl000006.result
rpl000008.result
rpl000009.result
rpl000010.result
rpl000011.result
rpl000012.result
rpl000013.result
rpl000015.result
rpl000017.result
rpl000018.result
rpl_alter.result
rpl_auto_increment.result
rpl_auto_increment_11932.result
rpl_chain_temp_table.result
rpl_change_master.result
rpl_charset.result
rpl_commit_after_flush.result
rpl_create_database.result
rpl_ddl.result
rpl_deadlock.result
rpl_delete_all.result
rpl_do_grant.result
rpl_drop.result
rpl_drop_db.result
rpl_drop_temp.result
rpl_dual_pos_advance.result
rpl_EE_error.result
rpl_empty_master_crash.result
rpl_error_ignored_table.result
rpl_failed_optimize.result
rpl_failsafe.result
rpl_flush_log_loop.result
rpl_flush_tables.result
rpl_free_items.result
rpl_get_lock.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
rpl_heap.result
rpl_ignore_grant.result
rpl_ignore_revoke.result
rpl_ignore_table.result
rpl_init_slave.result
rpl_innodb.result
rpl_insert_id.result
rpl_insert_ignore.result
rpl_insert_select.result
rpl_loaddata.result
rpl_loaddata_rule_m.result
rpl_loaddata_rule_s.result
rpl_loaddatalocal.result
rpl_log.result
rpl_log_pos.result
rpl_many_optimize.result
rpl_master_pos_wait.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
rpl_max_relay_size.result
rpl_misc_functions.result
rpl_multi_delete.result
rpl_multi_delete2.result
rpl_multi_query.result
rpl_multi_update.result
rpl_multi_update2.result
rpl_multi_update3.result
rpl_multi_update4.result
rpl_mystery22.result
rpl_openssl.result
rpl_optimize.result
rpl_ps.result
rpl_redirect.result
rpl_relayrotate.result
rpl_relayspace.result
rpl_replicate_do.result
rpl_reset_slave.result
rpl_rewrite_db.result
rpl_rotate_logs.result
rpl_server_id1.result
rpl_server_id2.result
rpl_session_var.result
rpl_set_charset.result
rpl_skip_error.result
rpl_slave_status.result
rpl_sp.result
rpl_sp_effects.result
rpl_sporadic_master.result
rpl_start_stop_slave.result
rpl_temporary.result
rpl_timezone.result
rpl_trigger.result
rpl_trunc_temp.result
rpl_until.result
rpl_user_variables.result
rpl_variables.result
rpl_view.result
schema.result
select.result
select_found.result
select_safe.result
server_id.require
server_id1.require
show_check.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
skip_grants.result
skip_name_resolve.result
slave-running.result
slave-stopped.result
sp-big.result
sp-code.result
sp-destruct.result
sp-dynamic.result
sp-error.result
sp-prelocking.result Fix for bug#19634 "Re-execution of multi-delete which involve trigger/stored 2006-06-21 01:50:20 +04:00
sp-security.result Bug#18630: Arguments of suid routine calculated in wrong security 2006-07-13 17:12:31 +04:00
sp-threads.result
sp-vars.result Bug#17226: Variable set in cursor on first iteration is assigned 2006-06-30 18:14:22 +04:00
sp.result Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime 2006-06-27 00:52:56 +04:00
sp.result.orig
sp_notembedded.result
sp_trans.result
sql_mode.result
ssl.result
ssl_compress.result
status.result
strict.result
subselect.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
subselect2.result
subselect_gis.result
subselect_innodb.result
subselect_notembedded.result
sum_distinct-big.result
sum_distinct.result
symlink.result
synchronization.result
sysdate_is_now.result
system_mysql_db.result
system_mysql_db_refs.result
tablelock.result
temp_table.result
testdb_only.require
timezone.result
timezone2.result
timezone3.result
timezone_grant.result
trigger-compat.result
trigger-grant.result
trigger-trans.result
trigger.result Merge mysql.com:/home/tomash/src/mysql_ab/mysql-5.0 2006-06-28 23:54:18 +04:00
true.require
truncate.result
type_binary.result
type_bit.result
type_bit_innodb.result
type_blob.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
type_date.result
type_datetime.result
type_decimal.result
type_enum.result
type_float.result
type_nchar.result
type_newdecimal-big.result
type_newdecimal.result
type_ranges.result
type_set.result
type_time.result
type_timestamp.result #19409: Test 'func_timestamp' fails on Windows x64 2006-06-22 20:50:38 +02:00
type_uint.result
type_varchar.result
type_year.result
udf.result
union.result
update.result
user_limits.result
user_var-binlog.result
user_var.result
varbinary.result
variables.result Merge mysql.com:/opt/local/work/mysql-5.0-release 2006-06-29 15:25:03 +04:00
view.result Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement 2006-06-27 21:28:32 +04:00
view_grant.result manual merge 2006-06-21 13:01:00 +03:00
view_query_cache.result
wait_timeout.result
warnings.result
windows.result
xa.result