1
0
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:
holyfoot/hf@mysql.com/hfmain.(none)
2007-04-04 14:01:47 +05:00
parent 45fb6c90f0
commit f55ab9ef5e
7 changed files with 63 additions and 16 deletions

View File

@ -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

View File

@ -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