|
1 | 1 | /* |
2 | | - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. |
| 2 | + Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
3 | 3 |
|
4 | 4 | This program is free software; you can redistribute it and/or modify |
5 | 5 | it under the terms of the GNU General Public License as published by |
@@ -47,7 +47,7 @@ static char *add_load_option(char *ptr,const char *object, |
47 | 47 |
|
48 | 48 | static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0, |
49 | 49 | replace=0,silent=0,ignore=0,opt_compress=0, |
50 | | - opt_low_priority= 0, tty_password= 0; |
| 50 | + opt_low_priority= 0, tty_password= 0, opt_secure_auth= 1; |
51 | 51 | static my_bool debug_info_flag= 0, debug_check_flag= 0; |
52 | 52 | static uint opt_use_threads=0, opt_local_file=0, my_end_arg= 0; |
53 | 53 | static char *opt_password=0, *current_user=0, |
@@ -161,6 +161,9 @@ static struct my_option my_long_options[] = |
161 | 161 | 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, |
162 | 162 | {"replace", 'r', "If duplicate unique key was found, replace old row.", |
163 | 163 | &replace, &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, |
| 164 | + {"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it" |
| 165 | + " uses old (pre-4.1.1) protocol.", |
| 166 | + &opt_secure_auth, &opt_secure_auth, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, |
164 | 167 | #ifdef HAVE_SMEM |
165 | 168 | {"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME, |
166 | 169 | "Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name, |
@@ -440,6 +443,8 @@ static MYSQL *db_connect(char *host, char *database, |
440 | 443 | mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol); |
441 | 444 | if (opt_bind_addr) |
442 | 445 | mysql_options(mysql,MYSQL_OPT_BIND,opt_bind_addr); |
| 446 | + if (!opt_secure_auth) |
| 447 | + mysql_options(mysql, MYSQL_SECURE_AUTH,(char*)&opt_secure_auth); |
443 | 448 | #ifdef HAVE_SMEM |
444 | 449 | if (shared_memory_base_name) |
445 | 450 | mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); |
|
0 commit comments