| 1 |
source include/platform.inc; |
| 2 |
source include/not_embedded.inc; |
| 3 |
|
| 4 |
if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'parsec'`) |
| 5 |
{ |
| 6 |
--skip Needs parsec plugin |
| 7 |
} |
| 8 |
|
| 9 |
if (!$PARSEC_SO) { |
| 10 |
skip No auth_parsec plugin; |
| 11 |
} |
| 12 |
--error ER_PASSWD_LENGTH |
| 13 |
create user test1@'%' identified via parsec using 'pwd'; |
| 14 |
create user test1@'%' identified via parsec using PASSWORD('pwd'); |
| 15 |
--replace_regex /:[A-Za-z0-9+\/]{43}'/:password'/ /:[A-Za-z0-9+\/]{24}:/:salt:/ |
| 16 |
show grants for test1@'%'; |
| 17 |
connect con1, localhost, test1, pwd; |
| 18 |
select 1, USER(), CURRENT_USER(); |
| 19 |
disconnect con1; |
| 20 |
connect con2, localhost, test1, pwd; |
| 21 |
select 2, USER(), CURRENT_USER(); |
| 22 |
disconnect con2; |
| 23 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $MASTER_MYPORT MASTER_MYPORT |
| 24 |
--error ER_ACCESS_DENIED_ERROR |
| 25 |
connect con3, localhost, test1, wrong_pwd; |
| 26 |
|
| 27 |
connection default; |
| 28 |
|
| 29 |
create function have_ssl() returns char(3) |
| 30 |
return (select if(variable_value > '','yes','no') as 'have_ssl' |
| 31 |
from information_schema.session_status |
| 32 |
where variable_name='ssl_cipher'); |
| 33 |
grant execute on test.* to test1@'%'; |
| 34 |
|
| 35 |
let host=; |
| 36 |
if ($MTR_COMBINATION_WIN) { |
| 37 |
# see ssl_autoverify.test |
| 38 |
let host=--host=127.0.0.2; |
| 39 |
} |
| 40 |
|
| 41 |
--echo # mysql -utest1 -ppwd --ssl-verify-server-cert -e "select test.have_ssl()" |
| 42 |
--exec $MYSQL --protocol tcp $host -utest1 -ppwd --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1 |
| 43 |
|
| 44 |
drop function have_ssl; |
| 45 |
drop user test1@'%'; |
| 46 |
|
| 47 |
|
| 48 |
--echo # MDEV-34854 Parsec sends garbage when using an empty password |
| 49 |
create user test2@'%' identified via parsec using PASSWORD(''); |
| 50 |
--replace_regex /:[A-Za-z0-9+\/]{43}'/:password'/ /:[A-Za-z0-9+\/]{24}:/:salt:/ |
| 51 |
show grants for test2@'%'; |
| 52 |
connect con4, localhost, test2,; |
| 53 |
select 4, USER(), CURRENT_USER(); |
| 54 |
disconnect con4; |
| 55 |
|
| 56 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK $MASTER_MYPORT MASTER_MYPORT |
| 57 |
--error ER_ACCESS_DENIED_ERROR |
| 58 |
connect con5, localhost, test2, "wrong_pwd"; |
| 59 |
connection default; |
| 60 |
drop user test2@'%'; |