diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-01-25 10:20:45 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-01-25 10:20:45 +0100 |
commit | de10e214115ecc89087386ecad8bddee2a1e1608 (patch) | |
tree | 7920f7d3b1d8ff90329b00177a8cc4242368d87b /mysql-test | |
parent | 746152959a8787f3c7cf6b1c710fc1ee6c54419f (diff) | |
parent | 9142c50b0751c1ee964b9b56ef2378fc2bef202c (diff) | |
download | mariadb-git-de10e214115ecc89087386ecad8bddee2a1e1608.tar.gz |
5.2 merge
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/change_user_notembedded.result | 5 | ||||
-rw-r--r-- | mysql-test/r/failed_auth_3909.result | 21 | ||||
-rw-r--r-- | mysql-test/r/mysqltest.result | 6 | ||||
-rw-r--r-- | mysql-test/t/change_user_notembedded.test | 24 | ||||
-rw-r--r-- | mysql-test/t/failed_auth_3909.test | 37 |
5 files changed, 90 insertions, 3 deletions
diff --git a/mysql-test/r/change_user_notembedded.result b/mysql-test/r/change_user_notembedded.result new file mode 100644 index 00000000000..60579d15ec2 --- /dev/null +++ b/mysql-test/r/change_user_notembedded.result @@ -0,0 +1,5 @@ +ERROR 28000: Access denied for user 'foo'@'localhost' (using password: YES) +ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO) +ERROR 28000: Access denied for user 'foo'@'localhost' (using password: YES) +ERROR 08S01: Unknown command +ERROR 08S01: Unknown command diff --git a/mysql-test/r/failed_auth_3909.result b/mysql-test/r/failed_auth_3909.result new file mode 100644 index 00000000000..36c812b6932 --- /dev/null +++ b/mysql-test/r/failed_auth_3909.result @@ -0,0 +1,21 @@ +optimize table mysql.user; +Table Op Msg_type Msg_text +mysql.user optimize status OK +insert mysql.user (user,plugin) values ('foo','bar'),('bar','bar'),('baz','bar'); +Warnings: +Warning 1364 Field 'ssl_cipher' doesn't have a default value +Warning 1364 Field 'x509_issuer' doesn't have a default value +Warning 1364 Field 'x509_subject' doesn't have a default value +Warning 1364 Field 'auth_string' doesn't have a default value +flush privileges; +connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET); +ERROR HY000: Plugin 'bar' is not loaded +connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO) +connect(localhost,u2,password,test,MASTER_PORT,MASTER_SOCKET); +ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES) +ERROR HY000: Plugin 'bar' is not loaded +ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO) +ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES) +delete from mysql.user where plugin = 'bar'; +flush privileges; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 312dd7d0312..32658866951 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -847,9 +847,9 @@ a int(11) YES NULL b varchar(255) YES NULL c datetime YES NULL drop table t1; -mysqltest: At line 1: change user failed: Unknown database 'inexistent' -mysqltest: At line 1: change user failed: Access denied for user 'inexistent'@'localhost' (using password: NO) -mysqltest: At line 1: change user failed: Access denied for user 'root'@'localhost' (using password: YES) +mysqltest: At line 1: query 'change_user root,,inexistent' failed: 1049: Unknown database 'inexistent' +mysqltest: At line 1: query 'change_user inexistent,,test' failed: 1045: Access denied for user 'inexistent'@'localhost' (using password: NO) +mysqltest: At line 1: query 'change_user root,inexistent,test' failed: 1045: Access denied for user 'root'@'localhost' (using password: YES) REPLACED_FILE1.txt file1.txt file2.txt diff --git a/mysql-test/t/change_user_notembedded.test b/mysql-test/t/change_user_notembedded.test new file mode 100644 index 00000000000..bf5d1956cd5 --- /dev/null +++ b/mysql-test/t/change_user_notembedded.test @@ -0,0 +1,24 @@ +source include/not_embedded.inc; + +# +# MDEV-3915 COM_CHANGE_USER allows fast password brute-forcing +# +# only three failed change_user per connection. +# successful change_user do NOT reset the counter +# +connect (test,localhost,root,,); +connection test; +--error 1045 +change_user foo,bar; +--error 1045 +change_user foo; +change_user; +--error 1045 +change_user foo,bar; +--error 1047 +change_user foo,bar; +--error 1047 +change_user; +disconnect test; +connection default; + diff --git a/mysql-test/t/failed_auth_3909.test b/mysql-test/t/failed_auth_3909.test new file mode 100644 index 00000000000..3179794d155 --- /dev/null +++ b/mysql-test/t/failed_auth_3909.test @@ -0,0 +1,37 @@ +source include/not_embedded.inc; + +# +# MDEV-3909 remote user enumeration +# +# verify that for some failed login attemps (with wrong user names) +# the server requests a plugin +# +optimize table mysql.user; +insert mysql.user (user,plugin) values ('foo','bar'),('bar','bar'),('baz','bar'); +flush privileges; + +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error ER_PLUGIN_IS_NOT_LOADED +connect (fail,localhost,u1); + +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error ER_ACCESS_DENIED_ERROR +connect (fail,localhost,u2); + +--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT +--error ER_ACCESS_DENIED_ERROR +connect (fail,localhost,u2,password); + +--error ER_PLUGIN_IS_NOT_LOADED +change_user u1; + +--error ER_ACCESS_DENIED_ERROR +change_user u2; + +--error ER_ACCESS_DENIED_ERROR +change_user u2,password; + +delete from mysql.user where plugin = 'bar'; +flush privileges; + + |