summaryrefslogtreecommitdiff
path: root/mysql-test/suite/plugins/t/pam.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-06-30 20:41:26 +0200
committerSergei Golubchik <serg@mariadb.org>2019-07-02 14:27:31 +0200
commitdd93028dae22f00a6b23ff27d348ff1a4722ee88 (patch)
treec9a5e1fe924af4dd6cd8311c0707818cf4a12db8 /mysql-test/suite/plugins/t/pam.test
parentec494cb1fadb40ae25b944bb1229fc2d6f88e8c6 (diff)
downloadmariadb-git-dd93028dae22f00a6b23ff27d348ff1a4722ee88.tar.gz
MDEV-19878 pam v2: pam password authentication doesn't work at all
* wait() for the child process to die, let it rest in peace * fix incorrect parentheses * if there was no password on the command line or in .cnf file, pkt will be "", and we need to request the user to enter the password * make sure that auth->salt is always allocated on a permanent memroot. when called from set_user_salt_if_needed(), user_copy and its auth_str are on the thd memroot, but auth_copy->salt is then copied to auth->salt * adjust service files so that systemd wouldn't interfere with our setuid executables also * print the pam error message in debug mode
Diffstat (limited to 'mysql-test/suite/plugins/t/pam.test')
-rw-r--r--mysql-test/suite/plugins/t/pam.test20
1 files changed, 19 insertions, 1 deletions
diff --git a/mysql-test/suite/plugins/t/pam.test b/mysql-test/suite/plugins/t/pam.test
index 040b26ef8b8..1bb1fa2c230 100644
--- a/mysql-test/suite/plugins/t/pam.test
+++ b/mysql-test/suite/plugins/t/pam.test
@@ -15,7 +15,12 @@ EOF
--write_file $MYSQLTEST_VARDIR/tmp/pam_ugly.txt
crash pam module
-666
+616
+select user(), current_user(), database();
+EOF
+
+--write_file $MYSQLTEST_VARDIR/tmp/pam_good2.txt
+9212
select user(), current_user(), database();
EOF
@@ -37,6 +42,18 @@ EOF
--error 1
--exec $MYSQL_TEST -u test_pam --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/pam_ugly.txt
+--echo #
+--echo # athentication is successful
+--echo #
+--error 0
+--exec $MYSQL_TEST -u test_pam -pgoodpassword --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/pam_good2.txt
+
+--echo #
+--echo # athentication is unsuccessful
+--echo #
+--error 1
+--exec $MYSQL_TEST -u test_pam -pbadpassword --plugin-dir=$plugindir < $MYSQLTEST_VARDIR/tmp/pam_good2.txt
+
drop user test_pam;
drop user pam_test;
create user PAM_TEST identified via pam using 'mariadb_mtr';
@@ -54,6 +71,7 @@ set global pam_winbind_workaround=1;
--exec $MYSQL_TEST -u PAM_TEST < $MYSQLTEST_VARDIR/tmp/pam_good.txt
--remove_file $MYSQLTEST_VARDIR/tmp/pam_good.txt
+--remove_file $MYSQLTEST_VARDIR/tmp/pam_good2.txt
--remove_file $MYSQLTEST_VARDIR/tmp/pam_bad.txt
--remove_file $MYSQLTEST_VARDIR/tmp/pam_ugly.txt
drop user PAM_TEST;