Index: /PS5518/branches/my56-yinfeng-for-simple-case/client/mysql.cc =================================================================== --- /PS5518/branches/my56-yinfeng-for-simple-case/client/mysql.cc (revision 5660) +++ /PS5518/branches/my56-yinfeng-for-simple-case/client/mysql.cc (revision 5668) @@ -1775,6 +1775,8 @@ "password sandbox mode.", &opt_connect_expired_password, &opt_connect_expired_password, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"skip-insecure-warning", 0, "Don't print warning if password was specified.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; Index: /PS5518/branches/my56-yinfeng-for-simple-case/mysql-test/r/connect.result =================================================================== --- /PS5518/branches/my56-yinfeng-for-simple-case/mysql-test/r/connect.result (revision 5660) +++ /PS5518/branches/my56-yinfeng-for-simple-case/mysql-test/r/connect.result (revision 5668) @@ -416,3 +416,14 @@ # ------------------------------------------------------------------ # -- End of 5.6 tests # ------------------------------------------------------------------ +# +# Test option --skip-insecure-warning +# +GRANT ALL ON *.* TO 'siw'@'%' IDENTIFIED BY 'siw'; +FLUSH PRIVILEGES; +Warning: Using a password on the command line interface can be insecure. +USER() +siw@localhost +USER() +siw@localhost +DROP USER siw; Index: /PS5518/branches/my56-yinfeng-for-simple-case/mysql-test/t/connect.test =================================================================== --- /PS5518/branches/my56-yinfeng-for-simple-case/mysql-test/t/connect.test (revision 5660) +++ /PS5518/branches/my56-yinfeng-for-simple-case/mysql-test/t/connect.test (revision 5668) @@ -502,12 +502,20 @@ DROP USER wl6587@localhost; - --echo # ------------------------------------------------------------------ --echo # -- End of 5.6 tests --echo # ------------------------------------------------------------------ +--echo # +--echo # Test option --skip-insecure-warning +--echo # + +GRANT ALL ON *.* TO 'siw'@'%' IDENTIFIED BY 'siw'; +FLUSH PRIVILEGES; +--exec $MYSQL -usiw --password=siw test -e "SELECT USER()" 2>&1 +--exec $MYSQL -usiw --password=siw --skip-insecure-warning test -e "SELECT USER()" 2>&1 +DROP USER siw; # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc Index: /PS5518/branches/my56-yinfeng-for-simple-case/mysys_ssl/my_getopt.cc =================================================================== --- /PS5518/branches/my56-yinfeng-for-simple-case/mysys_ssl/my_getopt.cc (revision 5660) +++ /PS5518/branches/my56-yinfeng-for-simple-case/mysys_ssl/my_getopt.cc (revision 5668) @@ -88,7 +88,7 @@ } static my_getopt_value getopt_get_addr; - +static bool opt_skip_insecure_warn= false; void my_getopt_register_get_addr(my_getopt_value func_addr) { getopt_get_addr= func_addr; @@ -237,10 +237,18 @@ */ for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++) { + /*Check if skip-insecure-warning was specified*/ + if (*pos && + (strcmp(*pos, "--skip-insecure-warning") == 0)) + { + opt_skip_insecure_warn= true; + if (!is_cmdline_arg) + break; + } + if (my_getopt_is_args_separator(*pos)) { is_cmdline_arg= 0; - break; } } @@ -660,7 +668,8 @@ { static my_bool password_warning_announced= FALSE; - if (!password_warning_announced) + if (!password_warning_announced + && !opt_skip_insecure_warn) { fprintf(stderr, "Warning: Using a password on the command line " "interface can be insecure.\n");