Browse Source
1. add --plugin-dir and --default-auth to mysqltest.
1. add --plugin-dir and --default-auth to mysqltest.
2. dialog plugin now always returns mysql->password if non-empty and the first question is of password type 3. split get_tty_password into get_tty_password_buff and strdup. 4. dialog plugin now uses get_tty_password by default 5. dialog.test 6. moved small tests of individual plugins into a dedicated suitepull/843/head
29 changed files with 202 additions and 93 deletions
-
7client/mysql.cc
-
44client/mysqltest.cc
-
10include/my_global.h
-
1include/mysql.h.pp
-
8include/mysql/client_plugin.h
-
32include/mysql/plugin.h
-
1include/mysql_com.h
-
1libmysql/CMakeLists.txt
-
31libmysql/get_password.c
-
2libmysqld/CMakeLists.txt
-
2mysql-test/Makefile.am
-
2mysql-test/mysql-test-run.pl
-
26mysql-test/suite/plugins/r/dialog.result
-
0mysql-test/suite/plugins/r/feedback_plugin_install.result
-
0mysql-test/suite/plugins/r/feedback_plugin_load.result
-
0mysql-test/suite/plugins/r/feedback_plugin_send.result
-
0mysql-test/suite/plugins/r/fulltext_plugin.result
-
51mysql-test/suite/plugins/t/dialog.test
-
0mysql-test/suite/plugins/t/feedback_plugin_install.opt
-
0mysql-test/suite/plugins/t/feedback_plugin_install.test
-
0mysql-test/suite/plugins/t/feedback_plugin_load.opt
-
0mysql-test/suite/plugins/t/feedback_plugin_load.test
-
2mysql-test/suite/plugins/t/feedback_plugin_send.test
-
0mysql-test/suite/plugins/t/fulltext_plugin.test
-
2plugin/auth/CMakeLists.txt
-
2plugin/auth/Makefile.am
-
64plugin/auth/dialog.c
-
5plugin/feedback/feedback.h
-
2sql/CMakeLists.txt
@ -0,0 +1,26 @@ |
|||
install plugin three_attempts soname 'dialog.so'; |
|||
create user test_dialog identified via three_attempts using 'SECRET'; |
|||
# |
|||
# -pSECRET is picked up, no questions asked. |
|||
# |
|||
select user(), current_user(); |
|||
user() current_user() |
|||
test_dialog@localhost test_dialog@% |
|||
# |
|||
# without -p. up to three questions are asked on the stdin. |
|||
# athentication is successful, the correct pasword is on the third line |
|||
# |
|||
Password, please: *** |
|||
Password, please: **** |
|||
Password, please: ****** |
|||
select user(), current_user(); |
|||
user() current_user() |
|||
test_dialog@localhost test_dialog@% |
|||
# |
|||
# athentication is unsuccessful, first three lines are all wrong |
|||
# |
|||
Password, please: *** |
|||
Password, please: **** |
|||
Password, please: ***** |
|||
drop user test_dialog; |
|||
uninstall plugin three_attempts; |
@ -0,0 +1,51 @@ |
|||
# |
|||
# test for the client "dialog" plugin |
|||
# |
|||
|
|||
--source include/not_embedded.inc |
|||
|
|||
if (!$DIALOG_SO) { |
|||
skip No dialog auth plugin; |
|||
} |
|||
|
|||
--replace_result .dll .so |
|||
eval install plugin three_attempts soname '$DIALOG_SO'; |
|||
create user test_dialog identified via three_attempts using 'SECRET'; |
|||
|
|||
let $plugindir=`SELECT @@global.plugin_dir`; |
|||
|
|||
--write_file $MYSQLTEST_VARDIR/tmp/dialog_good.txt |
|||
foo |
|||
1234 |
|||
SECRET |
|||
select user(), current_user(); |
|||
EOF |
|||
|
|||
--write_file $MYSQLTEST_VARDIR/tmp/dialog_bad.txt |
|||
foo |
|||
1234 |
|||
wrong |
|||
SECRET |
|||
EOF |
|||
|
|||
--echo # |
|||
--echo # -pSECRET is picked up, no questions asked. |
|||
--echo # |
|||
--exec echo "select user(), current_user();"|$MYSQL_TEST -u test_dialog -pSECRET --plugin-dir=$plugindir |
|||
|
|||
--echo # |
|||
--echo # without -p. up to three questions are asked on the stdin. |
|||
--echo # athentication is successful, the correct pasword is on the third line |
|||
--echo # |
|||
--exec $MYSQL_TEST -u test_dialog --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/dialog_good.txt |
|||
|
|||
--echo # |
|||
--echo # athentication is unsuccessful, first three lines are all wrong |
|||
--echo # |
|||
--error 1 |
|||
--exec $MYSQL_TEST -u test_dialog --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/dialog_bad.txt |
|||
|
|||
--remove_file $MYSQLTEST_VARDIR/tmp/dialog_good.txt |
|||
--remove_file $MYSQLTEST_VARDIR/tmp/dialog_bad.txt |
|||
drop user test_dialog; |
|||
uninstall plugin three_attempts; |
@ -1,4 +1,4 @@ |
|||
source t/feedback_plugin_load.test; |
|||
source feedback_plugin_load.test; |
|||
|
|||
if (!$MTR_FEEDBACK_PLUGIN) { |
|||
skip MTR_FEEDBACK_PLUGIN is not set; |
@ -1,3 +1,3 @@ |
|||
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake") |
|||
SET(AUTH_SOURCES dialog.c) |
|||
SET(AUTH_SOURCES dialog.c ${CMAKE_SOURCE_DIR}/libmysql/get_password.c) |
|||
MYSQL_PLUGIN(AUTH) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue