| 1 |
############################################################################### |
| 2 |
# # |
| 3 |
# Authorization and authentication using the SHA256_PASSWORD plugin at # |
| 4 |
# server and client side # |
| 5 |
# # |
| 6 |
# # |
| 7 |
# # |
| 8 |
# Creation Date: 2012-12-10 # |
| 9 |
# Author : Tanjot Singh Uppal # |
| 10 |
# # |
| 11 |
# # |
| 12 |
# Description:Test Cases of authenticating the hashed password using the # |
| 13 |
# sha256_password plugin at the server side as well as the client side # |
| 14 |
# # |
| 15 |
# # |
| 16 |
############################################################################### |
| 17 |
|
| 18 |
--source include/mysql_upgrade_preparation.inc |
| 19 |
|
| 20 |
# This test will intentionally generate errors in the server error log |
| 21 |
# when a broken password is inserted into the mysql.user table. |
| 22 |
# The below suppression is to clear those errors. |
| 23 |
|
| 24 |
|
| 25 |
--disable_query_log |
| 26 |
call mtr.add_suppression(".*Password salt for user.*"); |
| 27 |
--enable_query_log |
| 28 |
|
| 29 |
--echo |
| 30 |
--echo |
| 31 |
--echo =========================================================================================================================================== |
| 32 |
--echo Checking the password authentication using the sha256_password plugin at the client and mysql_native_password plugin at the server side |
| 33 |
--echo =========================================================================================================================================== |
| 34 |
--echo |
| 35 |
|
| 36 |
# Checking the password authentication with sha256_password plugin |
| 37 |
# Creating 2 users and encrypting the server side password with the sha256_password plugin |
| 38 |
|
| 39 |
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password'; |
| 40 |
|
| 41 |
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'sha256_password'; |
| 42 |
|
| 43 |
# Verifying the server side plugin used to be sha256_password |
| 44 |
|
| 45 |
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='sha256_password'; |
| 46 |
--echo 1 Expected |
| 47 |
|
| 48 |
select (select plugin from mysql.user where User='Tanjotuser2' and Host='127.0.0.1')='sha256_password'; |
| 49 |
--echo 1 Expected |
| 50 |
|
| 51 |
# Verifying the client connection using the same sha256_password plugin and NULL password |
| 52 |
|
| 53 |
connect(con1,localhost,Tanjotuser1,,,); |
| 54 |
connect(con2,127.0.0.1,Tanjotuser2,,,); |
| 55 |
|
| 56 |
# Verifying the client connection using the same sha256_password plugin and junk password |
| 57 |
|
| 58 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 59 |
--replace_result "NO" "" "YES" "" |
| 60 |
--disable_query_log |
| 61 |
--error ER_ACCESS_DENIED_ERROR |
| 62 |
connect(con3,localhost,Tanjotuser1," ",,); |
| 63 |
--enable_query_log |
| 64 |
|
| 65 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 66 |
--replace_result "NO" "" "YES" "" |
| 67 |
--disable_query_log |
| 68 |
--error ER_ACCESS_DENIED_ERROR |
| 69 |
connect(con4,127.0.0.1,Tanjotuser2," ",,); |
| 70 |
--enable_query_log |
| 71 |
|
| 72 |
# setting the password for the 2 users using the sha256_password plugin |
| 73 |
|
| 74 |
connection default; |
| 75 |
|
| 76 |
SET PASSWORD FOR 'Tanjotuser1'@'localhost'='abc'; |
| 77 |
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'='abc'; |
| 78 |
|
| 79 |
# Verifying the client connection using the sha256_password plugin and NULL password |
| 80 |
|
| 81 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 82 |
--replace_result "NO" "" "YES" "" |
| 83 |
--disable_query_log |
| 84 |
--error ER_ACCESS_DENIED_ERROR |
| 85 |
connect(con5,localhost,Tanjotuser1,,,); |
| 86 |
--enable_query_log |
| 87 |
|
| 88 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 89 |
--replace_result "NO" "" "YES" "" |
| 90 |
--disable_query_log |
| 91 |
--error ER_ACCESS_DENIED_ERROR |
| 92 |
connect(con6,127.0.0.1,Tanjotuser2,,,); |
| 93 |
--enable_query_log |
| 94 |
|
| 95 |
# Verifying the client connection using the sha256_password plugin and junk password |
| 96 |
|
| 97 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 98 |
--replace_result "NO" "" "YES" "" |
| 99 |
--disable_query_log |
| 100 |
--error ER_ACCESS_DENIED_ERROR |
| 101 |
connect(con7,localhost,Tanjotuser1," ",,); |
| 102 |
--enable_query_log |
| 103 |
|
| 104 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 105 |
--replace_result "NO" "" "YES" "" |
| 106 |
--disable_query_log |
| 107 |
--error ER_ACCESS_DENIED_ERROR |
| 108 |
connect(con8,127.0.0.1,Tanjotuser2," ",,); |
| 109 |
--enable_query_log |
| 110 |
|
| 111 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 112 |
--replace_result "NO" "" "YES" "" |
| 113 |
--disable_query_log |
| 114 |
--error ER_ACCESS_DENIED_ERROR |
| 115 |
connect(con9,localhost,Tanjotuser1,"%",,); |
| 116 |
--enable_query_log |
| 117 |
|
| 118 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 119 |
--replace_result "NO" "" "YES" "" |
| 120 |
--disable_query_log |
| 121 |
--error ER_ACCESS_DENIED_ERROR |
| 122 |
connect(con10,127.0.0.1,Tanjotuser2,"%",,); |
| 123 |
--enable_query_log |
| 124 |
|
| 125 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 126 |
--replace_result "NO" "" "YES" "" |
| 127 |
--disable_query_log |
| 128 |
--error ER_ACCESS_DENIED_ERROR |
| 129 |
connect(con11,localhost,Tanjotuser1,"_",,); |
| 130 |
--enable_query_log |
| 131 |
|
| 132 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 133 |
--replace_result "NO" "" "YES" "" |
| 134 |
--disable_query_log |
| 135 |
--error ER_ACCESS_DENIED_ERROR |
| 136 |
connect(con12,127.0.0.1,Tanjotuser2,"_",,); |
| 137 |
--enable_query_log |
| 138 |
|
| 139 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 140 |
--replace_result "NO" "" "YES" "" |
| 141 |
--disable_query_log |
| 142 |
--error ER_ACCESS_DENIED_ERROR |
| 143 |
connect(con13,localhost,Tanjotuser1,"0",,); |
| 144 |
--enable_query_log |
| 145 |
|
| 146 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 147 |
--replace_result "NO" "" "YES" "" |
| 148 |
--disable_query_log |
| 149 |
--error ER_ACCESS_DENIED_ERROR |
| 150 |
connect(con14,127.0.0.1,Tanjotuser2,"0",,); |
| 151 |
--enable_query_log |
| 152 |
|
| 153 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 154 |
--replace_result "NO" "" "YES" "" |
| 155 |
--disable_query_log |
| 156 |
--error ER_ACCESS_DENIED_ERROR |
| 157 |
connect(con15,localhost,Tanjotuser1,"^",,); |
| 158 |
--enable_query_log |
| 159 |
|
| 160 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 161 |
--replace_result "NO" "" "YES" "" |
| 162 |
--disable_query_log |
| 163 |
--error ER_ACCESS_DENIED_ERROR |
| 164 |
connect(con16,127.0.0.1,Tanjotuser2,"^",,); |
| 165 |
--enable_query_log |
| 166 |
|
| 167 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 168 |
--replace_result "NO" "" "YES" "" |
| 169 |
--disable_query_log |
| 170 |
--error ER_ACCESS_DENIED_ERROR |
| 171 |
connect(con17,localhost,Tanjotuser1,'\$',,); |
| 172 |
--enable_query_log |
| 173 |
|
| 174 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 175 |
--replace_result "NO" "" "YES" "" |
| 176 |
--disable_query_log |
| 177 |
--error ER_ACCESS_DENIED_ERROR |
| 178 |
connect(con18,127.0.0.1,Tanjotuser2,'\$',,); |
| 179 |
--enable_query_log |
| 180 |
|
| 181 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 182 |
--replace_result "NO" "" "YES" "" |
| 183 |
--disable_query_log |
| 184 |
--error ER_ACCESS_DENIED_ERROR |
| 185 |
connect(con19,localhost,Tanjotuser1,"&",,); |
| 186 |
--enable_query_log |
| 187 |
|
| 188 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 189 |
--replace_result "NO" "" "YES" "" |
| 190 |
--disable_query_log |
| 191 |
--error ER_ACCESS_DENIED_ERROR |
| 192 |
connect(con20,127.0.0.1,Tanjotuser2,"&",,); |
| 193 |
--enable_query_log |
| 194 |
|
| 195 |
# Dropping the created users |
| 196 |
|
| 197 |
connection default; |
| 198 |
|
| 199 |
DROP USER 'Tanjotuser1'@'localhost'; |
| 200 |
DROP USER 'Tanjotuser2'@'127.0.0.1'; |
| 201 |
|
| 202 |
--echo |
| 203 |
--echo |
| 204 |
--echo ==================================================================================================== |
| 205 |
--echo checking the integrity of long password (more than 40 chars) using sha256_password plugin |
| 206 |
--echo ==================================================================================================== |
| 207 |
--echo |
| 208 |
|
| 209 |
|
| 210 |
# Checking the password authentication with sha256_password plugin |
| 211 |
# Creating 2 users and encrypting the server side password with the sha256_password plugin |
| 212 |
|
| 213 |
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password'; |
| 214 |
|
| 215 |
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'sha256_password'; |
| 216 |
|
| 217 |
# setting the password for the 2 users using the sha256_password plugin |
| 218 |
|
| 219 |
SET PASSWORD FOR 'Tanjotuser1'@'localhost'='$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________'; |
| 220 |
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'='$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________'; |
| 221 |
|
| 222 |
|
| 223 |
# Verifying the client access denied passing null password |
| 224 |
|
| 225 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 226 |
--replace_result "NO" "" "YES" "" |
| 227 |
--disable_query_log |
| 228 |
--error ER_ACCESS_DENIED_ERROR |
| 229 |
connect(con39,localhost,Tanjotuser1," ",,); |
| 230 |
--enable_query_log |
| 231 |
|
| 232 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 233 |
--replace_result "NO" "" "YES" "" |
| 234 |
--disable_query_log |
| 235 |
--error ER_ACCESS_DENIED_ERROR |
| 236 |
connect(con40,127.0.0.1,Tanjotuser2," ",,); |
| 237 |
--enable_query_log |
| 238 |
|
| 239 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 240 |
--replace_result "NO" "" "YES" "" |
| 241 |
--disable_query_log |
| 242 |
--error ER_ACCESS_DENIED_ERROR |
| 243 |
connect(con41,localhost,Tanjotuser1,,,); |
| 244 |
--enable_query_log |
| 245 |
|
| 246 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 247 |
--replace_result "NO" "" "YES" "" |
| 248 |
--disable_query_log |
| 249 |
--error ER_ACCESS_DENIED_ERROR |
| 250 |
connect(con42,127.0.0.1,Tanjotuser2,,,); |
| 251 |
--enable_query_log |
| 252 |
|
| 253 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 254 |
--replace_result "NO" "" "YES" "" |
| 255 |
--disable_query_log |
| 256 |
--error ER_ACCESS_DENIED_ERROR |
| 257 |
connect(con43,localhost,Tanjotuser1,"@_",,); |
| 258 |
--enable_query_log |
| 259 |
|
| 260 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 261 |
--replace_result "NO" "" "YES" "" |
| 262 |
--disable_query_log |
| 263 |
--error ER_ACCESS_DENIED_ERROR |
| 264 |
connect(con44,127.0.0.1,Tanjotuser2,"@_",,); |
| 265 |
--enable_query_log |
| 266 |
|
| 267 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 268 |
--replace_result "NO" "" "YES" "" |
| 269 |
--disable_query_log |
| 270 |
--error ER_ACCESS_DENIED_ERROR |
| 271 |
connect(con45,localhost,Tanjotuser1,"$_",,); |
| 272 |
--enable_query_log |
| 273 |
|
| 274 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 275 |
--replace_result "NO" "" "YES" "" |
| 276 |
--disable_query_log |
| 277 |
--error ER_ACCESS_DENIED_ERROR |
| 278 |
connect(con46,127.0.0.1,Tanjotuser2,"$_",,); |
| 279 |
--enable_query_log |
| 280 |
|
| 281 |
|
| 282 |
# Dropping the created users |
| 283 |
|
| 284 |
connection default; |
| 285 |
|
| 286 |
DROP USER 'Tanjotuser1'@'localhost'; |
| 287 |
DROP USER 'Tanjotuser2'@'127.0.0.1'; |
| 288 |
|
| 289 |
--echo |
| 290 |
--echo |
| 291 |
--echo ============================================================================================================================================ |
| 292 |
--echo Checking the password authentication using the sha256_password plugin at the client and sha256_password plugin at the server side |
| 293 |
--echo ============================================================================================================================================ |
| 294 |
--echo |
| 295 |
|
| 296 |
--echo # Restart server with default-authentication-plugin=sha256_password; |
| 297 |
|
| 298 |
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect; |
| 299 |
--exec echo "wait" > $restart_file |
| 300 |
--shutdown_server |
| 301 |
--source include/wait_until_disconnected.inc |
| 302 |
-- exec echo "restart:--default-authentication-plugin=sha256_password " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 303 |
-- enable_reconnect |
| 304 |
-- source include/wait_until_connected_again.inc |
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
# Checking the password authentication with sha256_password plugin |
| 309 |
# Creating 2 users and encrypting the server side password with the sha256_password plugin |
| 310 |
|
| 311 |
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password'; |
| 312 |
|
| 313 |
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'sha256_password'; |
| 314 |
|
| 315 |
# Verifying the server side plugin used to be sha256_password |
| 316 |
|
| 317 |
select (select plugin from mysql.user where User='Tanjotuser1' and Host='localhost')='sha256_password'; |
| 318 |
--echo 1 Expected |
| 319 |
|
| 320 |
select (select plugin from mysql.user where User='Tanjotuser2' and Host='127.0.0.1')='sha256_password'; |
| 321 |
--echo 1 Expected |
| 322 |
|
| 323 |
# Verifying the client connection using the same sha256_password plugin and NULL password |
| 324 |
|
| 325 |
connect(con89,localhost,Tanjotuser1,,,); |
| 326 |
connect(con90,127.0.0.1,Tanjotuser2,,,); |
| 327 |
|
| 328 |
# Verifying the client connection using the same sha256_password plugin and junk password |
| 329 |
|
| 330 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 331 |
--replace_result "NO" "" "YES" "" |
| 332 |
--disable_query_log |
| 333 |
--error ER_ACCESS_DENIED_ERROR |
| 334 |
connect(con91,localhost,Tanjotuser1," ",,); |
| 335 |
--enable_query_log |
| 336 |
|
| 337 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 338 |
--replace_result "NO" "" "YES" "" |
| 339 |
--disable_query_log |
| 340 |
--error ER_ACCESS_DENIED_ERROR |
| 341 |
connect(con92,127.0.0.1,Tanjotuser2," ",,); |
| 342 |
--enable_query_log |
| 343 |
|
| 344 |
# setting the password for the 2 users using the sha256_password plugin |
| 345 |
|
| 346 |
connection default; |
| 347 |
|
| 348 |
SET PASSWORD FOR 'Tanjotuser1'@'localhost'='abc'; |
| 349 |
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'='abc'; |
| 350 |
|
| 351 |
# Verifying the client connection using the same sha256_password plugin and NULL password |
| 352 |
|
| 353 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 354 |
--replace_result "NO" "" "YES" "" |
| 355 |
--disable_query_log |
| 356 |
--error ER_ACCESS_DENIED_ERROR |
| 357 |
connect(con93,localhost,Tanjotuser1,,,); |
| 358 |
--enable_query_log |
| 359 |
|
| 360 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 361 |
--replace_result "NO" "" "YES" "" |
| 362 |
--disable_query_log |
| 363 |
--error ER_ACCESS_DENIED_ERROR |
| 364 |
connect(con94,127.0.0.1,Tanjotuser2,,,); |
| 365 |
--enable_query_log |
| 366 |
|
| 367 |
# Verifying the client connection using the same sha256_password plugin and junk password |
| 368 |
|
| 369 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 370 |
--replace_result "NO" "" "YES" "" |
| 371 |
--disable_query_log |
| 372 |
--error ER_ACCESS_DENIED_ERROR |
| 373 |
connect(con95,localhost,Tanjotuser1," ",,); |
| 374 |
--enable_query_log |
| 375 |
|
| 376 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 377 |
--replace_result "NO" "" "YES" "" |
| 378 |
--disable_query_log |
| 379 |
--error ER_ACCESS_DENIED_ERROR |
| 380 |
connect(con96,127.0.0.1,Tanjotuser2," ",,); |
| 381 |
--enable_query_log |
| 382 |
|
| 383 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 384 |
--replace_result "NO" "" "YES" "" |
| 385 |
--disable_query_log |
| 386 |
--error ER_ACCESS_DENIED_ERROR |
| 387 |
connect(con97,localhost,Tanjotuser1,"%",,); |
| 388 |
--enable_query_log |
| 389 |
|
| 390 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 391 |
--replace_result "NO" "" "YES" "" |
| 392 |
--disable_query_log |
| 393 |
--error ER_ACCESS_DENIED_ERROR |
| 394 |
connect(con98,127.0.0.1,Tanjotuser2,"%",,); |
| 395 |
--enable_query_log |
| 396 |
|
| 397 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 398 |
--replace_result "NO" "" "YES" "" |
| 399 |
--disable_query_log |
| 400 |
--error ER_ACCESS_DENIED_ERROR |
| 401 |
connect(con99,localhost,Tanjotuser1,"_",,); |
| 402 |
--enable_query_log |
| 403 |
|
| 404 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 405 |
--replace_result "NO" "" "YES" "" |
| 406 |
--disable_query_log |
| 407 |
--error ER_ACCESS_DENIED_ERROR |
| 408 |
connect(con100,127.0.0.1,Tanjotuser2,"_",,); |
| 409 |
--enable_query_log |
| 410 |
|
| 411 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 412 |
--replace_result "NO" "" "YES" "" |
| 413 |
--disable_query_log |
| 414 |
--error ER_ACCESS_DENIED_ERROR |
| 415 |
connect(con101,localhost,Tanjotuser1,"0",,); |
| 416 |
--enable_query_log |
| 417 |
|
| 418 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 419 |
--replace_result "NO" "" "YES" "" |
| 420 |
--disable_query_log |
| 421 |
--error ER_ACCESS_DENIED_ERROR |
| 422 |
connect(con102,127.0.0.1,Tanjotuser2,"0",,); |
| 423 |
--enable_query_log |
| 424 |
|
| 425 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 426 |
--replace_result "NO" "" "YES" "" |
| 427 |
--disable_query_log |
| 428 |
--error ER_ACCESS_DENIED_ERROR |
| 429 |
connect(con103,localhost,Tanjotuser1,"^",,); |
| 430 |
--enable_query_log |
| 431 |
|
| 432 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 433 |
--replace_result "NO" "" "YES" "" |
| 434 |
--disable_query_log |
| 435 |
--error ER_ACCESS_DENIED_ERROR |
| 436 |
connect(con104,127.0.0.1,Tanjotuser2,"^",,); |
| 437 |
--enable_query_log |
| 438 |
|
| 439 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 440 |
--replace_result "NO" "" "YES" "" |
| 441 |
--disable_query_log |
| 442 |
--error ER_ACCESS_DENIED_ERROR |
| 443 |
connect(con105,localhost,Tanjotuser1,"\$",,); |
| 444 |
--enable_query_log |
| 445 |
|
| 446 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 447 |
--replace_result "NO" "" "YES" "" |
| 448 |
--disable_query_log |
| 449 |
--error ER_ACCESS_DENIED_ERROR |
| 450 |
connect(con106,127.0.0.1,Tanjotuser2,"\$",,); |
| 451 |
--enable_query_log |
| 452 |
|
| 453 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 454 |
--replace_result "NO" "" "YES" "" |
| 455 |
--disable_query_log |
| 456 |
--error ER_ACCESS_DENIED_ERROR |
| 457 |
connect(con107,localhost,Tanjotuser1,"&",,); |
| 458 |
--enable_query_log |
| 459 |
|
| 460 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 461 |
--replace_result "NO" "" "YES" "" |
| 462 |
--disable_query_log |
| 463 |
--error ER_ACCESS_DENIED_ERROR |
| 464 |
connect(con108,127.0.0.1,Tanjotuser2,"&",,); |
| 465 |
--enable_query_log |
| 466 |
|
| 467 |
|
| 468 |
# Dropping the created users |
| 469 |
|
| 470 |
connection default; |
| 471 |
|
| 472 |
DROP USER 'Tanjotuser1'@'localhost'; |
| 473 |
DROP USER 'Tanjotuser2'@'127.0.0.1'; |
| 474 |
|
| 475 |
--echo |
| 476 |
--echo |
| 477 |
--echo ==================================================================================================== |
| 478 |
--echo checking the integrity of long password (more than 40 chars) using sha256_password plugin |
| 479 |
--echo ==================================================================================================== |
| 480 |
--echo |
| 481 |
|
| 482 |
|
| 483 |
# Checking the password authentication with sha256_password plugin |
| 484 |
# Creating 2 users and encrypting the server side password with the sha256_password plugin |
| 485 |
|
| 486 |
CREATE USER 'Tanjotuser1'@'localhost' IDENTIFIED WITH 'sha256_password'; |
| 487 |
|
| 488 |
CREATE USER 'Tanjotuser2'@'127.0.0.1' IDENTIFIED WITH 'sha256_password'; |
| 489 |
|
| 490 |
# setting the password for the 2 users using the sha256_password plugin |
| 491 |
|
| 492 |
SET PASSWORD FOR 'Tanjotuser1'@'localhost'='$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________'; |
| 493 |
SET PASSWORD FOR 'Tanjotuser2'@'127.0.0.1'='$$$$$$$$$$^^^^^^^^^^&&&&&&&&&&**********((((((((((##########!!!!!!!!!!@@@@@@@@@@ @@@@@@@@@@__________'; |
| 494 |
|
| 495 |
|
| 496 |
# Verifying the client access denied passing null password |
| 497 |
|
| 498 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 499 |
--replace_result "NO" "" "YES" "" |
| 500 |
--disable_query_log |
| 501 |
--error ER_ACCESS_DENIED_ERROR |
| 502 |
connect(con127,localhost,Tanjotuser1," ",,); |
| 503 |
--enable_query_log |
| 504 |
|
| 505 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 506 |
--replace_result "NO" "" "YES" "" |
| 507 |
--disable_query_log |
| 508 |
--error ER_ACCESS_DENIED_ERROR |
| 509 |
connect(con128,127.0.0.1,Tanjotuser2," ",,); |
| 510 |
--enable_query_log |
| 511 |
|
| 512 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 513 |
--replace_result "NO" "" "YES" "" |
| 514 |
--disable_query_log |
| 515 |
--error ER_ACCESS_DENIED_ERROR |
| 516 |
connect(con127,localhost,Tanjotuser1,,,); |
| 517 |
--enable_query_log |
| 518 |
|
| 519 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 520 |
--replace_result "NO" "" "YES" "" |
| 521 |
--disable_query_log |
| 522 |
--error ER_ACCESS_DENIED_ERROR |
| 523 |
connect(con128,127.0.0.1,Tanjotuser2,,,); |
| 524 |
--enable_query_log |
| 525 |
|
| 526 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 527 |
--replace_result "NO" "" "YES" "" |
| 528 |
--disable_query_log |
| 529 |
--error ER_ACCESS_DENIED_ERROR |
| 530 |
connect(con129,localhost,Tanjotuser1,"@_",,); |
| 531 |
--enable_query_log |
| 532 |
|
| 533 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 534 |
--replace_result "NO" "" "YES" "" |
| 535 |
--disable_query_log |
| 536 |
--error ER_ACCESS_DENIED_ERROR |
| 537 |
connect(con130,127.0.0.1,Tanjotuser2,"@_",,); |
| 538 |
--enable_query_log |
| 539 |
|
| 540 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 541 |
--replace_result "NO" "" "YES" "" |
| 542 |
--disable_query_log |
| 543 |
--error ER_ACCESS_DENIED_ERROR |
| 544 |
connect(con131,localhost,Tanjotuser1,"$_",,); |
| 545 |
--enable_query_log |
| 546 |
|
| 547 |
--replace_result $MASTER_MYSOCK MASTER_MYSOCK |
| 548 |
--replace_result "NO" "" "YES" "" |
| 549 |
--disable_query_log |
| 550 |
--error ER_ACCESS_DENIED_ERROR |
| 551 |
connect(con132,127.0.0.1,Tanjotuser2,"$_",,); |
| 552 |
--enable_query_log |
| 553 |
|
| 554 |
|
| 555 |
# Dropping the created users |
| 556 |
|
| 557 |
disconnect con1; |
| 558 |
disconnect con2; |
| 559 |
#disconnect con3; |
| 560 |
#disconnect con4; |
| 561 |
#disconnect con5; |
| 562 |
#disconnect con6; |
| 563 |
#disconnect con7; |
| 564 |
#disconnect con8; |
| 565 |
#disconnect con9; |
| 566 |
#disconnect con10; |
| 567 |
#disconnect con11; |
| 568 |
#disconnect con12; |
| 569 |
#disconnect con13; |
| 570 |
#disconnect con14; |
| 571 |
#disconnect con15; |
| 572 |
#disconnect con16; |
| 573 |
#disconnect con17; |
| 574 |
#disconnect con18; |
| 575 |
#disconnect con19; |
| 576 |
#disconnect con20; |
| 577 |
#disconnect con39; |
| 578 |
#disconnect con40; |
| 579 |
#disconnect con41; |
| 580 |
#disconnect con42; |
| 581 |
#disconnect con43; |
| 582 |
#disconnect con44; |
| 583 |
#disconnect con45; |
| 584 |
#disconnect con46; |
| 585 |
disconnect con89; |
| 586 |
disconnect con90; |
| 587 |
#disconnect con91; |
| 588 |
#disconnect con92; |
| 589 |
#disconnect con93; |
| 590 |
#disconnect con94; |
| 591 |
#disconnect con95; |
| 592 |
#disconnect con96; |
| 593 |
#disconnect con97; |
| 594 |
#disconnect con98; |
| 595 |
#disconnect con99; |
| 596 |
#disconnect con100; |
| 597 |
#disconnect con101; |
| 598 |
#disconnect con102; |
| 599 |
#disconnect con103; |
| 600 |
#disconnect con104; |
| 601 |
#disconnect con105; |
| 602 |
#disconnect con106; |
| 603 |
#disconnect con107; |
| 604 |
#disconnect con108; |
| 605 |
#disconnect con127; |
| 606 |
#disconnect con128; |
| 607 |
#disconnect con129; |
| 608 |
#disconnect con130; |
| 609 |
#disconnect con131; |
| 610 |
#disconnect con132; |
| 611 |
|
| 612 |
|
| 613 |
connection default; |
| 614 |
|
| 615 |
DROP USER 'Tanjotuser1'@'localhost'; |
| 616 |
DROP USER 'Tanjotuser2'@'127.0.0.1'; |
| 617 |
|
| 618 |
# Restore default settings in opt file and clean up |
| 619 |
--let $restart_parameters = restart: |
| 620 |
--source include/restart_mysqld.inc |