diff options
-rwxr-xr-x | BUILD/check-cpu | 3 | ||||
-rw-r--r-- | VC++Files/mysys/mysys.vcproj | 43 | ||||
-rw-r--r-- | client/mysql_upgrade.c | 12 | ||||
-rw-r--r-- | mysql-test/t/myisam.test | 2 | ||||
-rw-r--r-- | mysql-test/t/query_cache_notembedded.test | 4 | ||||
-rw-r--r-- | mysql-test/t/rpl000015.test | 2 | ||||
-rw-r--r-- | mysql-test/t/rpl000017.test | 2 | ||||
-rw-r--r-- | mysql-test/t/rpl_rotate_logs.test | 2 | ||||
-rw-r--r-- | scripts/mysql_secure_installation.sh | 29 |
9 files changed, 81 insertions, 18 deletions
diff --git a/BUILD/check-cpu b/BUILD/check-cpu index fb69fd0acae..07d8e71b0e4 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -177,8 +177,7 @@ check_cpu () { touch __test.c while [ "$cpu_arg" ] ; do - # FIXME: echo -n isn't portable - see contortions autoconf goes through - echo -n testing $cpu_arg "... " >&2 + printf "testing $cpu_arg ... " >&2 # compile check check_cpu_cflags=`eval echo $check_cpu_args` diff --git a/VC++Files/mysys/mysys.vcproj b/VC++Files/mysys/mysys.vcproj index 3f2c5e755ac..87100ce8e5e 100644 --- a/VC++Files/mysys/mysys.vcproj +++ b/VC++Files/mysys/mysys.vcproj @@ -3418,6 +3418,49 @@ </FileConfiguration> </File> <File + RelativePath="my_getpagesize.c"> + <FileConfiguration + Name="Debug|Win32"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="" + PreprocessorDefinitions=""/> + </FileConfiguration> + <FileConfiguration + Name="Max|Win32"> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions=""/> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32"> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions=""/> + </FileConfiguration> + <FileConfiguration + Name="TLS_DEBUG|Win32"> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="" + PreprocessorDefinitions=""/> + </FileConfiguration> + <FileConfiguration + Name="TLS|Win32"> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + AdditionalIncludeDirectories="" + PreprocessorDefinitions=""/> + </FileConfiguration> + </File> + <File RelativePath="my_mmap.c"> <FileConfiguration Name="Debug|Win32"> diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 38902df2bbf..21132dd16c0 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -143,6 +143,7 @@ void set_extra_default(int id, const struct my_option *opt) case 'f': /* --force is ours */ case 'u': /* --user passed on cmdline */ case 'T': /* --debug-info is not accepted by mysqlcheck */ + case 'p': /* --password may change yet */ /* so, do nothing */ break; default: @@ -174,7 +175,7 @@ void set_extra_default(int id, const struct my_option *opt) d->id= id; d->name= opt->name; d->n_len= strlen(opt->name); - if (opt->arg_type != NO_ARG) + if (opt->arg_type != NO_ARG && opt->value) switch (opt->var_type & GET_TYPE_MASK) { case GET_BOOL: if (*((int *)opt->value)) @@ -320,6 +321,15 @@ static int create_defaults_file(const char *path, const char *forced_path) } dynstr_set(&buf, "\n[client]"); + if (opt_password) + { + if (dynstr_append(&buf, "\npassword=") + || dynstr_append(&buf, opt_password)) + { + ret = 1; + goto error; + } + } while (extra_defaults) { int len; diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index d785002abdd..02f914ae094 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -498,7 +498,7 @@ insert into t1 values (1),(2),(3),(4),(5),(6); insert into t2 values (1,1),(2,1); lock tables t1 read local, t2 read local; select straight_join * from t1,t2 force index (primary) where t1.a=t2.a; -connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock); +connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); insert into t2 values(2,0); disconnect root; connection default; diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test index 97be9f9f7ca..a4f4144d9c6 100644 --- a/mysql-test/t/query_cache_notembedded.test +++ b/mysql-test/t/query_cache_notembedded.test @@ -81,12 +81,12 @@ drop table t1, t2, t3, t11, t21; # # do not use QC if tables locked (BUG#12385) # -connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock); +connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connection root; CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ENGINE = MyISAM; LOCK TABLE t1 READ LOCAL; -connect (root2,localhost,root,,test,$MASTER_MYPORT,master.sock); +connect (root2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connection root2; INSERT INTO t1 VALUES (), (), (); connection root; diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test index d61b7120fa1..d05e4df66b1 100644 --- a/mysql-test/t/rpl000015.test +++ b/mysql-test/t/rpl000015.test @@ -1,5 +1,5 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); -connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); +connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK); connection master; reset master; show master status; diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test index 866b7fd1c25..c1d36d53501 100644 --- a/mysql-test/t/rpl000017.test +++ b/mysql-test/t/rpl000017.test @@ -1,5 +1,5 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); -connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); +connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK); connection master; reset master; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index ee49f92910a..25e54306d6e 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -16,7 +16,7 @@ connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); --disable_warnings drop table if exists t1, t2, t3, t4; --enable_warnings -connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); +connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK); system cat /dev/null > $MYSQLTEST_VARDIR/slave-data/master.info; system chmod 000 $MYSQLTEST_VARDIR/slave-data/master.info; connection slave; diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index f437a3d8bfc..6c2d88d6d29 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -21,6 +21,16 @@ command=".mysql.$$" trap "interrupt" 2 rootpass="" +echo_n= +echo_c= + +set_echo_compat() { + case `echo "testing\c"`,`echo -n testing` in + *c*,-n*) echo_n= echo_c= ;; + *c*,*) echo_n=-n echo_c= ;; + *) echo_n= echo_c='\c' ;; + esac +} prepare() { touch $config $command @@ -44,7 +54,7 @@ get_root_password() { status=1 while [ $status -eq 1 ]; do stty -echo - echo -n "Enter current password for root (enter for none): " + echo $echo_n "Enter current password for root (enter for none): $echo_c" read password echo stty echo @@ -64,10 +74,10 @@ get_root_password() { set_root_password() { stty -echo - echo -n "New password: " + echo $echo_n "New password: $echo_c" read password1 echo - echo -n "Re-enter new password: " + echo $echo_n "Re-enter new password: $echo_c" read password2 echo stty echo @@ -172,6 +182,7 @@ cleanup() { # The actual script starts here prepare +set_echo_compat echo echo @@ -200,11 +211,11 @@ echo "root user without the proper authorisation." echo if [ $hadpass -eq 0 ]; then - echo -n "Set root password? [Y/n] " + echo $echo_n "Set root password? [Y/n] $echo_c" else echo "You already have a root password set, so you can safely answer 'n'." echo - echo -n "Change the root password? [Y/n] " + echo $echo_n "Change the root password? [Y/n] $echo_c" fi read reply @@ -231,7 +242,7 @@ echo "go a bit smoother. You should remove them before moving into a" echo "production environment." echo -echo -n "Remove anonymous users? [Y/n] " +echo $echo_n "Remove anonymous users? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then @@ -250,7 +261,7 @@ echo "Normally, root should only be allowed to connect from 'localhost'. This" echo "ensures that someone cannot guess at the root password from the network." echo -echo -n "Disallow root login remotely? [Y/n] " +echo $echo_n "Disallow root login remotely? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then echo " ... skipping." @@ -269,7 +280,7 @@ echo "access. This is also intended only for testing, and should be removed" echo "before moving into a production environment." echo -echo -n "Remove test database and access to it? [Y/n] " +echo $echo_n "Remove test database and access to it? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then echo " ... skipping." @@ -287,7 +298,7 @@ echo "Reloading the privilege tables will ensure that all changes made so far" echo "will take effect immediately." echo -echo -n "Reload privilege tables now? [Y/n] " +echo $echo_n "Reload privilege tables now? [Y/n] $echo_c" read reply if [ "$reply" = "n" ]; then echo " ... skipping." |