mirror of
https://github.com/MariaDB/server.git
synced 2025-07-13 02:22:51 +03:00
Bug #23675 Partitions: possible security breach via alter
now we return different error message if user doesn't have SELECT grants
This commit is contained in:
@ -19,7 +19,16 @@ revoke alter on mysqltest_1.* from mysqltest_1@localhost;
|
||||
alter table t1 drop partition p3;
|
||||
ERROR 42000: ALTER command denied to user 'mysqltest_1'@'localhost' for table 't1'
|
||||
revoke select,alter,drop on mysqltest_1.* from mysqltest_1@localhost;
|
||||
drop user mysqltest_1@localhost;
|
||||
drop table t1;
|
||||
create table t1 (s1 int);
|
||||
insert into t1 values (1);
|
||||
grant alter on mysqltest_1.* to mysqltest_1@localhost;
|
||||
alter table t1 partition by list (s1) (partition p1 values in (2));
|
||||
ERROR HY000: Table has no partition for some existing values
|
||||
grant select, alter on mysqltest_1.* to mysqltest_1@localhost;
|
||||
alter table t1 partition by list (s1) (partition p1 values in (2));
|
||||
ERROR HY000: Table has no partition for value 1
|
||||
drop table t1;
|
||||
drop user mysqltest_1@localhost;
|
||||
drop schema mysqltest_1;
|
||||
End of 5.1 tests
|
||||
|
@ -52,8 +52,30 @@ disconnect conn3;
|
||||
connection default;
|
||||
|
||||
revoke select,alter,drop on mysqltest_1.* from mysqltest_1@localhost;
|
||||
drop user mysqltest_1@localhost;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #23675 Partitions: possible security breach via alter
|
||||
#
|
||||
|
||||
create table t1 (s1 int);
|
||||
insert into t1 values (1);
|
||||
grant alter on mysqltest_1.* to mysqltest_1@localhost;
|
||||
connect (conn4,localhost,mysqltest_1,,mysqltest_1);
|
||||
connection conn4;
|
||||
--error 1514
|
||||
alter table t1 partition by list (s1) (partition p1 values in (2));
|
||||
connection default;
|
||||
grant select, alter on mysqltest_1.* to mysqltest_1@localhost;
|
||||
disconnect conn4;
|
||||
connect (conn5,localhost,mysqltest_1,,mysqltest_1);
|
||||
--error 1514
|
||||
alter table t1 partition by list (s1) (partition p1 values in (2));
|
||||
disconnect conn5;
|
||||
connection default;
|
||||
drop table t1;
|
||||
|
||||
drop user mysqltest_1@localhost;
|
||||
drop schema mysqltest_1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user