1
############# mysql-test\t\secure_auth_func.test ##########################
3
# Variable Name: secure_auth #
5
# Access Type: Dynamic #
7
# Default Value: FALSE #
8
# Values: TRUE / 1, FALSE / 0 #
11
# Creation Date: 2008-02-22 #
12
# Author: Sharique Abdullah #
14
# Description: Test Cases of Dynamic System Variable "secure_auth " #
15
# that checks behavior of this variable in the following ways#
17
# * Valid & Invalid values #
18
# * Scope & Access method #
21
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22
# server-system-variables.html#option_mysqld_secure_auth #
24
###########################################################################
32
--source include/not_embedded.inc
38
SET @old_secure_auth = @@GLOBAL.secure_auth;
40
--echo '#--------------------FN_DYNVARS_144_01-------------------------#'
42
# Testing command line option value
45
SELECT @@GLOBAL.secure_auth;
46
--echo 1 / ON Expected
48
--echo '#--------------------FN_DYNVARS_144_02-------------------------#'
52
SET GLOBAL secure_auth = OFF;
55
# Creating user with password in NEW format
57
CREATE USER 'testUser'@'localhost' IDENTIFIED BY 'newpass';
59
--echo ** Connecting con_user1 using testUser **
60
connect (con_user1,localhost,testUser,newpass,);
62
--echo ** Connection default**
66
# Setting password in OLD format
68
SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass');
70
--echo ** Connecting con_user2 using testUser **
71
connect (con_user2,localhost,testUser,newpass,);
73
--echo ** Connection default**
76
--echo '#--------------------FN_DYNVARS_144_03-------------------------#'
80
SET GLOBAL secure_auth = ON;
83
# Setting password in NEW format
85
SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass');
87
--echo ** Connecting con_user3 using testUser **
88
connect (con_user3,localhost,testUser,newpass,);
89
--echo ** Connection default **
93
# Setting password in OLD format
95
SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass');
97
--echo ** Connecting con_user4 using testUser **
99
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
100
connect (con_user4,localhost,testUser,newpass,);
102
--echo Expected error "Server is in secure auth mode"
104
--echo ** Connection default**
108
# Setting password back in NEW format
110
SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass');
112
--echo ** Connecting con_user4 using testUser **
113
connect (con_user4,localhost,testUser,newpass,);
115
--echo ** Connection default **
122
SET GLOBAL secure_auth = @old_secure_auth;
124
--echo Disconnecting Connections con_user1, con_user2, con_user3, con_user4
125
disconnect con_user1;
126
disconnect con_user2;
127
disconnect con_user3;
128
disconnect con_user4;
130
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testUser'@'localhost';
132
DROP USER 'testUser'@'localhost';