From: Nirbhay Choubey Date: May 30 2012 6:41pm Subject: bzr push into mysql-trunk branch (nirbhay.choubey:3781 to 3782) WL#5603 List-Archive: http://lists.mysql.com/commits/144037 Message-Id: <201205301841.q4UIfnJo017101@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3782 Nirbhay Choubey 2012-05-31 WL#5603 : Revise how we handle passwords on the command line Fix for an issue on Windows. modified: client/mysql_config_editor.cc mysql-test/r/mysql_config_editor.result mysys_ssl/default.c 3781 Nirbhay Choubey 2012-05-30 WL#5603 : Revise how we handle passwords on the command line Modifications addressing Review comments. modified: client/mysql_config_editor.cc mysql-test/r/mysql_config_editor.result mysql-test/t/mysql_config_editor.test mysys_ssl/default.c mysys_ssl/my_aes.cc mysys_ssl/my_default.h === modified file 'client/mysql_config_editor.cc' --- a/client/mysql_config_editor.cc 2012-05-30 13:56:12 +0000 +++ b/client/mysql_config_editor.cc 2012-05-30 18:40:01 +0000 @@ -193,7 +193,8 @@ int execute_commands(int argc, char **ar init_dynamic_string(&path_buf, "", MY_LINE_MAX, MY_LINE_MAX); init_dynamic_string(&file_buf, "", file_size, 3 * MY_LINE_MAX); - for (; argc > 0; argv++, argc--) { + for (; argc > 0; argv++, argc--) + { if ((error= check_and_create_login_file())) goto done; @@ -323,7 +324,7 @@ static my_bool check_and_create_login_fi #define S_IRWXO 00007 #endif - const int access_flag= (O_RDWR); + const int access_flag= (O_RDWR | O_BINARY); const ushort create_mode= (S_IRUSR | S_IWUSR ); const ushort create_mode_all= (S_IRWXU | S_IRWXG | S_IRWXO); === modified file 'mysql-test/r/mysql_config_editor.result' --- a/mysql-test/r/mysql_config_editor.result 2012-05-30 13:56:12 +0000 +++ b/mysql-test/r/mysql_config_editor.result 2012-05-30 18:40:01 +0000 @@ -130,7 +130,7 @@ File exists. File has the required permission. Opening the file. Reading the login key. -login key read successfully. +Login key read successfully. Executing set command. Successfully decrypted the login file. Key successfully written to the file. @@ -139,7 +139,7 @@ File exists. File has the required permission. Opening the file. Reading the login key. -login key read successfully. +Login key read successfully. Executing set command. Successfully decrypted the login file. Key successfully written to the file. === modified file 'mysys_ssl/default.c' --- a/mysys_ssl/default.c 2012-05-30 13:56:12 +0000 +++ b/mysys_ssl/default.c 2012-05-30 18:40:01 +0000 @@ -895,8 +895,17 @@ static int search_default_file_with_ext( } } #endif - if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0)))) - return 1; /* Ignore wrong files */ + if (is_login_file) + { + if ( !(fp = mysql_file_fopen(key_file_cnf, name, (O_RDONLY | O_BINARY), + MYF(0)))) + return 1; /* Ignore wrong files. */ + } + else + { + if ( !(fp = mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0)))) + return 1; /* Ignore wrong files */ + } while (mysql_file_getline(buff, sizeof(buff) - 1, fp)) { No bundle (reason: useless for push emails).