Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
305 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| --source include/not_embedded.inc | ||
|
|
||
| if (!$AUTH_NAMED_PIPE_SO) { | ||
| skip No auth_named_pipe plugin; | ||
| } | ||
|
|
||
| if (!$USERNAME) { | ||
| skip USER variable is undefined; | ||
| } | ||
|
|
||
| if (`SELECT count(*) <> 0 FROM mysql.user WHERE user = '$USERNAME'`) { | ||
| skip %USERNAME%=$USER which exists in mysql.user; | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| set @old_max_password_errors=@@max_password_errors; | ||
| set global max_password_errors=2; | ||
| create user u identified by 'good_pass'; | ||
| connect(localhost,u,bas_pass,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect con1, localhost, u, bas_pass; | ||
| ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES) | ||
| connect(localhost,u,bad_pass,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect con1, localhost, u, bad_pass; | ||
| ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES) | ||
| connect(localhost,u,good_pass,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect con1, localhost, u, good_pass; | ||
| ERROR HY000: User is blocked because of too many credential errors; unblock with 'FLUSH PRIVILEGES' | ||
| connect(localhost,u,bad_pass,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect con1, localhost, u, bad_pass; | ||
| ERROR HY000: User is blocked because of too many credential errors; unblock with 'FLUSH PRIVILEGES' | ||
| FLUSH PRIVILEGES; | ||
| connect con1, localhost, u, good_pass; | ||
| disconnect con1; | ||
| connect(localhost,u,bad_pass,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect con1, localhost, u, bad_pass; | ||
| ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES) | ||
| connect con1, localhost, u, good_pass; | ||
| disconnect con1; | ||
| connect(localhost,u,bad_pass,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect con1, localhost, u, bad_pass; | ||
| ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES) | ||
| connect con1, localhost, u, good_pass; | ||
| ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES) | ||
| ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES) | ||
| ERROR HY000: User is blocked because of too many credential errors; unblock with 'FLUSH PRIVILEGES' | ||
| disconnect con1; | ||
| connection default; | ||
| FLUSH PRIVILEGES; | ||
| connect(localhost,root,bas_pass,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect con1, localhost, root, bas_pass; | ||
| ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES) | ||
| connect(localhost,root,bad_pass,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect con1, localhost, root, bad_pass; | ||
| ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES) | ||
| connect con1, localhost, u, good_pass; | ||
| disconnect con1; | ||
| connection default; | ||
| DROP USER u; | ||
| FLUSH PRIVILEGES; | ||
| set global max_password_errors=@old_max_password_errors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --source include/not_embedded.inc | ||
| set @old_max_password_errors=@@max_password_errors; | ||
| set global max_password_errors=2; | ||
| create user u identified by 'good_pass'; | ||
|
|
||
| # Test that user is blocked after 'max_password_errors' bad passwords | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_ERROR; | ||
| connect(con1, localhost, u, bas_pass); | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_ERROR; | ||
| connect (con1, localhost, u, bad_pass); | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_USER_IS_BLOCKED; | ||
| connect(con1, localhost, u, good_pass); | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_USER_IS_BLOCKED; | ||
| connect(con1, localhost, u, bad_pass); | ||
|
|
||
|
|
||
| # Test that FLUSH PRIVILEGES clears the error | ||
| FLUSH PRIVILEGES; | ||
| connect (con1, localhost, u, good_pass); | ||
| disconnect con1; | ||
|
|
||
| # Test that good login clears the error | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_ERROR; | ||
| connect (con1, localhost, u, bad_pass); | ||
| connect (con1, localhost, u, good_pass); | ||
| disconnect con1; | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_ERROR; | ||
| connect (con1, localhost, u, bad_pass); | ||
| connect (con1, localhost, u, good_pass); | ||
|
|
||
| # Test the behavior of change_user | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_ERROR; | ||
| change_user u,bad_pass; | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_ERROR; | ||
| change_user u,bad_pass; | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_USER_IS_BLOCKED; | ||
| change_user u,good_pass; | ||
| disconnect con1; | ||
|
|
||
| connection default; | ||
| FLUSH PRIVILEGES; | ||
|
|
||
| #Test that root@localhost is not blocked, with password errors | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_ERROR; | ||
| connect(con1, localhost, root, bas_pass); | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_ERROR; | ||
| connect (con1, localhost, root, bad_pass); | ||
| connect (con1, localhost, u, good_pass); | ||
| disconnect con1; | ||
| connection default; | ||
| DROP USER u; | ||
| FLUSH PRIVILEGES; | ||
| set global max_password_errors=@old_max_password_errors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| set @old_max_password_errors=@@max_password_errors; | ||
| create user nosuchuser identified with 'named_pipe'; | ||
| set global max_password_errors=1; | ||
| connect(localhost,nosuchuser,,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect pipe_con,localhost,nosuchuser,,,,,PIPE; | ||
| ERROR 28000: Access denied for user 'nosuchuser'@'localhost' | ||
| connect(localhost,nosuchuser,,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect pipe_con,localhost,nosuchuser,,,,,PIPE; | ||
| ERROR 28000: Access denied for user 'nosuchuser'@'localhost' | ||
| DROP USER nosuchuser; | ||
| FLUSH PRIVILEGES; | ||
| set global max_password_errors=@old_max_password_errors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| set @old_max_password_errors=@@max_password_errors; | ||
| create user nosuchuser identified with 'unix_socket'; | ||
| set global max_password_errors=1; | ||
| connect(localhost,nosuchuser,,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect pipe_con,localhost,nosuchuser; | ||
| ERROR 28000: Access denied for user 'nosuchuser'@'localhost' | ||
| connect(localhost,nosuchuser,,test,MASTER_PORT,MASTER_SOCKET); | ||
| connect pipe_con,localhost,nosuchuser; | ||
| ERROR 28000: Access denied for user 'nosuchuser'@'localhost' | ||
| DROP USER nosuchuser; | ||
| FLUSH PRIVILEGES; | ||
| set global max_password_errors=@old_max_password_errors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --loose-enable-named-pipe --plugin-load=$AUTH_NAMED_PIPE_SO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Tests that max_password_errors has no effect on login errors with | ||
| # passwordless plugins (Windows version / auth_named_pipe) | ||
|
|
||
| --source include/not_embedded.inc | ||
| --source include/have_auth_named_pipe.inc | ||
| if (`SELECT '$USERNAME' = 'nosuchuser'`) { | ||
| skip skipped for nosuchuser; | ||
| } | ||
| set @old_max_password_errors=@@max_password_errors; | ||
| create user nosuchuser identified with 'named_pipe'; | ||
|
|
||
| set global max_password_errors=1; | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_NO_PASSWORD_ERROR; | ||
| connect(pipe_con,localhost,nosuchuser,,,,,PIPE); | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_NO_PASSWORD_ERROR; | ||
| connect(pipe_con,localhost,nosuchuser,,,,,PIPE); | ||
|
|
||
| DROP USER nosuchuser; | ||
| FLUSH PRIVILEGES; | ||
| set global max_password_errors=@old_max_password_errors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --loose-enable-named-pipe --plugin-load=$AUTH_SOCKET_SO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Tests that max_password_errors has no effect on login errors with | ||
| # passwordless plugins (Unix version / auth_unix_socket) | ||
|
|
||
| --source include/not_embedded.inc | ||
| --source include/have_unix_socket.inc | ||
|
|
||
| if (`SELECT '$USER' = 'nosuchuser'`) { | ||
| skip USER is nosuchuser; | ||
| } | ||
| set @old_max_password_errors=@@max_password_errors; | ||
| create user nosuchuser identified with 'unix_socket'; | ||
|
|
||
| set global max_password_errors=1; | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_NO_PASSWORD_ERROR; | ||
| connect(pipe_con,localhost,nosuchuser); | ||
| --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT | ||
| error ER_ACCESS_DENIED_NO_PASSWORD_ERROR; | ||
| connect(pipe_con,localhost,nosuchuser); | ||
|
|
||
| DROP USER nosuchuser; | ||
| FLUSH PRIVILEGES; | ||
| set global max_password_errors=@old_max_password_errors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.