Bug #3270 ALTER TABLE ... RENAME do not check rights of target table
Submitted: 23 Mar 2004 7:05 Modified: 26 Mar 2004 0:57
Reporter: Oleksandr Byelkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:3.23 OS:
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[23 Mar 2004 7:05] Oleksandr Byelkin
Description:
ALTER TABLE ... RENAME check CREATE/INSERT rights of old tables instead of new 
one. 
 

How to repeat:
 
drop database if exists mysqltest; 
connect (root,localhost,root,,test,0,mysql-master.sock); 
connection root; 
--disable_warnings 
create database if not exists mysqltest; 
--enable_warnings 
create table mysqltest.t1 (a int,b int,c int); 
grant all on mysqltest.t1 to mysqltest_1@localhost; 
connect (user1,localhost,mysqltest_1,,mysqltest,0,mysql-master.sock); 
connection user1; 
alter table t1 rename t2; 
 
 

Suggested fix:
change tables on tmp_table in sql_parse.cc where rights is checked
[23 Mar 2004 7:19] Oleksandr Byelkin
ChangeSet 
  1.1435 04/03/23 17:15:20 bell@sanja.is.com.ua +2 -0 
  used right table for grants check (BUG#3270)
[26 Mar 2004 0:57] Oleksandr Byelkin
patch sent to source repository