List:Commits« Previous MessageNext Message »
From:Nirbhay Choubey Date:May 21 2012 7:21pm
Subject:bzr push into mysql-trunk branch (nirbhay.choubey:3890 to 3891) WL#5603
View as plain text  
 3891 Nirbhay Choubey	2012-05-22
      WL#5603 :  Revise how we handle passwords on
                 the command line
      
      Minor modifications.

    modified:
      client/mysql_config_editor.cc
      mysql-test/t/mysql_config_editor.test
      mysys_ssl/default.c
 3890 Nirbhay Choubey	2012-05-21
      WL#5603 :  Revise how we handle passwords on
                 the command line
      
      Added mysql_config_editor tool.
      Added mysys_ssl library.
      Removed MySQL's AES implementation, OpenSSL/YaSSL
      implementations would be used instead.
      
      ----
      Fix some linking problems on various platforms.
      All executables which link with mysys_ssl must be linked with C++
      SET_TARGET_PROPERTIES(<executable> PROPERTIES LINKER_LANGUAGE CXX)
            
      Add new header file mysys_ssl/my_default.h
      
      MAX_CIPHER_STORE_LEN must be a #define, since it is used
      for stack allocation of arrays (windows requirement).
      
      ----
      Moved all declarations pertaining to default.c
      from include/my_sys.h to mysys_ssl/my_default.h.

    removed:
      include/rijndael.h
      mysys/rijndael.c
    added:
      client/mysql_config_editor.cc
      mysql-test/r/mysql_config_editor.result
      mysql-test/t/mysql_config_editor.test
      mysys_ssl/
      mysys_ssl/CMakeLists.txt
      mysys_ssl/my_aes.cc
      mysys_ssl/my_default.h
    renamed:
      mysys/default.c => mysys_ssl/default.c
      mysys/my_getopt.c => mysys_ssl/my_getopt.c
    modified:
      CMakeLists.txt
      client/CMakeLists.txt
      client/client_priv.h
      client/mysql.cc
      client/mysql_upgrade.c
      client/mysqladmin.cc
      client/mysqlbinlog.cc
      client/mysqlcheck.c
      client/mysqldump.c
      client/mysqlimport.c
      client/mysqlshow.c
      client/mysqlslap.c
      client/mysqltest.cc
      extra/CMakeLists.txt
      extra/my_print_defaults.c
      include/my_aes.h
      include/my_sys.h
      libmysql/CMakeLists.txt
      libmysqld/CMakeLists.txt
      libmysqld/examples/CMakeLists.txt
      mysql-test/lib/v1/mysql-test-run.pl
      mysql-test/mysql-test-run.pl
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysys/CMakeLists.txt
      sql-common/client.c
      sql/CMakeLists.txt
      sql/mysqld.cc
      sql/sql_plugin.cc
      storage/myisam/CMakeLists.txt
      storage/myisam/myisamchk.c
      storage/myisam/myisampack.c
      tests/CMakeLists.txt
      tests/mysql_client_test.c
      unittest/gunit/CMakeLists.txt
      mysys_ssl/default.c
      mysys_ssl/my_getopt.c
=== modified file 'client/mysql_config_editor.cc'
--- a/client/mysql_config_editor.cc	2012-05-21 08:03:19 +0000
+++ b/client/mysql_config_editor.cc	2012-05-21 19:20:28 +0000
@@ -41,7 +41,7 @@ static char *opt_user= NULL, *opt_passwo
 
 static my_bool opt_verbose, opt_all, tty_password= 0;
 
-void execute_commands(int argc, char **argv);
+int execute_commands(int argc, char **argv);
 static void print_login_path(DYNAMIC_STRING *file_buf, const char *path_name);
 static void remove_login_path(DYNAMIC_STRING *file_buf, const char *path_name);
 static char* locate_login_path(DYNAMIC_STRING *file_buf, const char *path_name);
@@ -151,22 +151,24 @@ int main(int argc, char *argv[])
   if (!opt_login_path)
     opt_login_path= my_strdup("client", MYF(MY_WME));
 
-  execute_commands(argc, argv);
+  error= execute_commands(argc, argv);
   exit(error ? 1 : 0);
   DBUG_RETURN(0);
 }
 
 
-void execute_commands(int argc, char **argv)
+int execute_commands(int argc, char **argv)
 {
   DBUG_ENTER("execute_commands");
   DYNAMIC_STRING file_buf, path_buf;
+  int error= 0;
 
   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--) {
-    check_and_create_login_file();
+    if ((error= check_and_create_login_file()))
+      goto done;
 
     switch(find_type(argv[0], &command_typelib, FIND_TYPE_BASIC)) {
       case MY_CONFIG_SET :
@@ -251,10 +253,11 @@ void execute_commands(int argc, char **a
     my_close(fd, MYF(MY_WME));
   }
 
+done:
   dynstr_free(&file_buf);
   dynstr_free(&path_buf);
 
-  DBUG_VOID_RETURN;
+  DBUG_RETURN(error);
 }
 
 
@@ -318,7 +321,11 @@ static my_bool check_and_create_login_fi
 
     file_size= stat_info.st_size;
 
+#ifdef _WIN32
+    if (1)
+#else
     if (!(create_mode ^ (stat_info.st_mode & create_mode_all)))
+#endif
     {
       verbose_msg("File has the required permission..\nOpening the file..\n");
       if ((fd= my_open(login_file, access_flag, MYF(MY_WME))) == -1)

=== modified file 'mysql-test/t/mysql_config_editor.test'
--- a/mysql-test/t/mysql_config_editor.test	2012-05-21 08:03:19 +0000
+++ b/mysql-test/t/mysql_config_editor.test	2012-05-21 19:20:28 +0000
@@ -114,8 +114,8 @@ FLUSH PRIVILEGES;
 --echo # Now trying to connect again..
 --echo # Connecting using 'test_user1'
 --echo #
---exec $MYSQLADMIN -S $MASTER_MYSOCK ping 2>&1
---exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK ping 2>&1
+--exec $MYSQLADMIN -S $MASTER_MYSOCK -P $MASTER_MYPORT ping 2>&1
+--exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT ping 2>&1
 --echo
 --echo # Connecting using 'test_user2'
 --echo #

=== modified file 'mysys_ssl/default.c'
--- a/mysys_ssl/default.c	2012-05-21 08:03:19 +0000
+++ b/mysys_ssl/default.c	2012-05-21 19:20:28 +0000
@@ -619,6 +619,12 @@ int my_load_defaults(const char *conf_fi
   uint args_sep= my_getopt_use_args_separator ? 1 : 0;
   DBUG_ENTER("load_defaults");
 
+  /*
+    Set it to FALSE, as this function can be invoked
+    multiple times with different conf_file.
+  */
+  defaults_already_read= FALSE;
+
   init_alloc_root(&alloc,512,0);
   if ((dirs= init_default_directories(&alloc)) == NULL)
     goto err;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (nirbhay.choubey:3890 to 3891) WL#5603Nirbhay Choubey22 May