#At file:///misc/mysql/forest/mysql-5.1-pe-stage/ based on revid:aelkin@stripped
2844 Tatiana A. Nurnberg 2009-03-27
Bug#43748: crash when non-super user tries to kill the replication threads
Test was flakey on some machines and showed spurious
reds for races.
New-and-improved test makes do with fewer statements,
no mysqltest-variables, and no backticks. Should hope-
fully be more robust. Heck, it's debatable whether we
should have a test for this, anyway.
@ mysql-test/suite/rpl/r/rpl_temporary.result
streamlined
@ mysql-test/suite/rpl/t/rpl_temporary.test
streamlined
modified:
mysql-test/suite/rpl/r/rpl_temporary.result
mysql-test/suite/rpl/t/rpl_temporary.test
=== modified file 'mysql-test/suite/rpl/r/rpl_temporary.result'
--- a/mysql-test/suite/rpl/r/rpl_temporary.result 2009-03-25 16:42:34 +0000
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result 2009-03-27 11:20:37 +0000
@@ -108,13 +108,16 @@ select * from t1;
a
1
drop table t1;
-Bug#43748
-make a non-privileged user on slave.
+-- Bug#43748
+-- make a user on the slave that can list but not kill system threads.
FLUSH PRIVILEGES;
-GRANT USAGE ON *.* TO user43748@stripped IDENTIFIED BY 'meow';
-try to KILL system-thread as non-privileged user.
-KILL `select id from information_schema.processlist where command='Binlog Dump'`;
-ERROR HY000: You are not owner of thread `select id from information_schema.processlist where command='Binlog Dump'`
-throw out test-user on slave.
+GRANT USAGE ON *.* TO user43748@stripped IDENTIFIED BY 'meow';
+GRANT PROCESS ON *.* TO user43748@stripped;
+-- try to KILL system-thread as that non-privileged user (on slave).
+SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1;
+KILL @id;
+Got one of the listed errors
+-- throw out test-user on slave.
DROP USER user43748@stripped;
-done. back to master.
+-- done. back to master.
+End of 5.1 tests
=== modified file 'mysql-test/suite/rpl/t/rpl_temporary.test'
--- a/mysql-test/suite/rpl/t/rpl_temporary.test 2009-03-25 16:42:34 +0000
+++ b/mysql-test/suite/rpl/t/rpl_temporary.test 2009-03-27 11:20:37 +0000
@@ -228,36 +228,34 @@ source include/delete_anonymous_users.in
# Bug#43748: crash when non-super user tries to kill the replication threads
#
---echo Bug#43748
+--echo -- Bug#43748
+--echo -- make a user on the slave that can list but not kill system threads.
connection slave;
---echo make a non-privileged user on slave.
-
FLUSH PRIVILEGES;
-GRANT USAGE ON *.* TO user43748@stripped IDENTIFIED BY 'meow';
-
-let $id = `SELECT id FROM information_schema.processlist WHERE user='system user' LIMIT 1`;
+GRANT USAGE ON *.* TO user43748@stripped IDENTIFIED BY 'meow';
+GRANT PROCESS ON *.* TO user43748@stripped;
+--echo -- try to KILL system-thread as that non-privileged user (on slave).
connect (cont43748,127.0.0.1,user43748,meow,test,$SLAVE_MYPORT,);
connection cont43748;
---echo try to KILL system-thread as non-privileged user.
+SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1;
---replace_result $id "`select id from information_schema.processlist where command='Binlog Dump'`"
---error ER_KILL_DENIED_ERROR
-eval KILL $id;
+--error ER_KILL_DENIED_ERROR,ER_NO_SUCH_THREAD
+KILL @id;
disconnect cont43748;
+--echo -- throw out test-user on slave.
connection slave;
---echo throw out test-user on slave.
DROP USER user43748@stripped;
+--echo -- done. back to master.
connection master;
---echo done. back to master.
-# End of tests
+--echo End of 5.1 tests
Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20090327112037-36r0m0ux3ffafd60.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (azundris:2844) Bug#43748 | Tatiana A. Nurnberg | 27 Mar |