Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
Fix issue #156
Browse files Browse the repository at this point in the history
* Unquoted directory names cause failures in shell scripts with
  `cd` command
  • Loading branch information
datacharmer committed Oct 7, 2022
1 parent 9a0f398 commit 05c6d22
Show file tree
Hide file tree
Showing 30 changed files with 39 additions and 33 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.69.3 07-Oct-2022

### BUGS FIXED

* Fix Issue #156 : unquoted directory names in shell scripts cause failure

## 1.69.2 04-Sep-2022

### BUGS FIXED
Expand Down
2 changes: 1 addition & 1 deletion common/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.69.2
1.69.3
2 changes: 1 addition & 1 deletion sandbox/templates/import/import_sb_include.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export MYSQL_TEST_LOGIN_FILE=/tmp/dont_break_my_sandboxes$RANDOM

function is_running
{
cd $SBDIR
cd "$SBDIR"
timeout=5
elapsed=0

Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/import/import_test_sb.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
source {{.SandboxDir}}/sb_include
export LD_LIBRARY_PATH=$CLIENT_LD_LIBRARY_PATH
cd $SBDIR
cd "$SBDIR"

fail=0
pass=0
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/multiple/exec_multi.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi

{{range .Nodes}}
echo "# server: {{.Node}} "
cd $SBDIR/{{.NodeLabel}}{{.Node}}
cd "$SBDIR/{{.NodeLabel}}{{.Node}}"
$@
cd - > /dev/null
{{end}}
2 changes: 1 addition & 1 deletion sandbox/templates/ndb/ndb_start_cluster.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
SBDIR={{.SandboxDir}}
BASEDIR={{.Basedir}}
cd $SBDIR
cd "$SBDIR"

if [ ! -d ndb_conf ]
then
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/ndb/ndb_stop_cluster.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SBDIR={{.SandboxDir}}
BASEDIR={{.Basedir}}
CLIENT_BASEDIR={{.ClientBasedir}}

cd $SBDIR
cd "$SBDIR"

if [ -f cluster_initialized ]
then
Expand Down
4 changes: 2 additions & 2 deletions sandbox/templates/replication/exec_all.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi
if [ -z "$ONLY_SLAVES" -o -n "$ONLY_MASTER" ]
then
echo "# {{.MasterLabel}} "
cd $SBDIR/{{.MasterLabel}}
cd "$SBDIR/{{.MasterLabel}}"
$@
cd - > /dev/null
fi
Expand All @@ -20,7 +20,7 @@ if [ -z "$ONLY_MASTER" -o -n "$ONLY_SLAVES" ]
then
{{range .Slaves}}
echo "# server: {{.Node}} "
cd $SBDIR/{{.NodeLabel}}{{.Node}}
cd "$SBDIR/{{.NodeLabel}}{{.Node}}"
$@
cd - > /dev/null
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/replication/init_slaves.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Don't use directly.
# This script is called by 'start_all' when needed
SBDIR={{.SandboxDir}}
cd $SBDIR
cd "$SBDIR"
# workaround for Bug#89959
$SBDIR/{{.MasterLabel}}/use -h {{.MasterIp}} -u {{.RplUser}} -p{{.RplPassword}} -e 'set @a=1'
if [ ! -f needs_initialization ]
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/replication/multi_source.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{.Copyright}}
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
SBDIR={{.SandboxDir}}
cd $SBDIR
cd "$SBDIR"

$SBDIR/use_all 'reset master'

Expand Down
4 changes: 2 additions & 2 deletions sandbox/templates/replication/multi_source_exec_masters.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{{.Copyright}}
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
SBDIR={{.SandboxDir}}
cd $SBDIR
cd "$SBDIR"

MASTERS="{{.MasterList}}"
SLAVES="{{.SlaveList}}"

for N in $MASTERS
do
echo "# server: $N"
cd $SBDIR/{{.NodeLabel}}$N
cd "$SBDIR/{{.NodeLabel}}$N"
$@
cd - > /dev/null
done
4 changes: 2 additions & 2 deletions sandbox/templates/replication/multi_source_exec_slaves.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{{.Copyright}}
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
SBDIR={{.SandboxDir}}
cd $SBDIR
cd "$SBDIR"

MASTERS="{{.MasterList}}"
SLAVES="{{.SlaveList}}"

for N in $SLAVES
do
echo "# server: $N"
cd $SBDIR/{{.NodeLabel}}$N
cd "$SBDIR/{{.NodeLabel}}$N"
$@
cd - > /dev/null
done
2 changes: 1 addition & 1 deletion sandbox/templates/replication/multi_source_test.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{.Copyright}}
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
SBDIR={{.SandboxDir}}
cd $SBDIR
cd "$SBDIR"

pass=0
fail=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{.Copyright}}
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
SBDIR={{.SandboxDir}}
cd $SBDIR
cd "$SBDIR"

MASTERS="{{.MasterList}}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{.Copyright}}
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
SBDIR={{.SandboxDir}}
cd $SBDIR
cd "$SBDIR"

MASTERS="{{.MasterList}}"
SLAVES="{{.SlaveList}}"
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/replication/semi_sync_start.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SBDIR={{.SandboxDir}}
sleep 2
set -x
cd $SBDIR
cd "$SBDIR"
$SBDIR/{{.MasterLabel}}/use -u root -e 'set global rpl_semi_sync_master_enabled=1'
echo "rpl_semi_sync_master_enabled=1" >> $SBDIR/{{.MasterLabel}}/my.sandbox.cnf
{{ range .Slaves }}
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/replication/test_replication.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{.Copyright}}
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
SBDIR={{.SandboxDir}}
cd $SBDIR
cd "$SBDIR"

if [ -x ./{{.MasterAbbr}} ]
then
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/add_option.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source {{.SandboxDir}}/sb_include
export LD_LIBRARY_PATH=$CLIENT_LD_LIBRARY_PATH

curdir=$SBDIR
cd $curdir
cd "$curdir"

if [ -z "$*" ]
then
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/clear.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source {{.SandboxDir}}/sb_include
export LD_LIBRARY_PATH=$CLIENT_LD_LIBRARY_PATH

cd $SBDIR
cd "$SBDIR"

#
# attempt to drop databases gracefully
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/clone_from.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{.Copyright}}
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
source {{.SandboxDir}}/sb_include
cd $SBDIR
cd "$SBDIR"

donor_sandbox=$1
if [ -z "$donor_sandbox" ]
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/init_db.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export DATADIR=$SBDIR/data
export LD_LIBRARY_PATH=$BASEDIR/lib:$BASEDIR/lib/mysql:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$BASEDIR/lib:$BASEDIR/lib/mysql:$DYLD_LIBRARY_PATH

cd $SBDIR
cd "$SBDIR"
if [ -d $DATADIR/mysql ]
then
echo "Initialization already done."
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/replicate_from.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
source {{.SandboxDir}}/sb_include

cd $SBDIR
cd "$SBDIR"

active_replication=$SBDIR/active_replication
remove_replication=$SBDIR/remove_replication
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/show_binlog.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source {{.SandboxDir}}/sb_include
export LD_LIBRARY_PATH=$CLIENT_LD_LIBRARY_PATH

curdir=$SBDIR
cd $curdir
cd "$curdir"

if [ ! -d ./data ]
then
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/show_log.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
source {{.SandboxDir}}/sb_include

cd $SBDIR
cd "$SBDIR"

if [ ! -d ./data ]
then
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/show_relaylog.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source {{.SandboxDir}}/sb_include
export LD_LIBRARY_PATH=$CLIENT_LD_LIBRARY_PATH
curdir=$SBDIR
cd $curdir
cd "$curdir"

if [ ! -d ./data ]
then
Expand Down
4 changes: 2 additions & 2 deletions sandbox/templates/single/start.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ else
rm -f $PIDFILE
fi
CURDIR=$(pwd)
cd $BASEDIR
cd "$BASEDIR"
$MYSQLD_SAFE --defaults-file=$SBDIR/my.sandbox.cnf $CUSTOM_MYSQLD $@ > "$SBDIR/start.log" 2>&1 &
cd $CURDIR
cd "$CURDIR"
ATTEMPTS=1
while [ ! -f $PIDFILE ]
do
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/sysbench.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source {{.SandboxDir}}/sb_include

[ -z "$SB_DATABASE" ] && SB_DATABASE=test

cd $SBDIR
cd "$SBDIR"
./use -e "CREATE DATABASE IF NOT EXISTS $SB_DATABASE"
sysbench --db-driver=mysql \
--mysql-user={{.DbUser}} \
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/sysbench_ready.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ then
exit 1
fi

cd $SBDIR
cd "$SBDIR"
./use -e "CREATE DATABASE IF NOT EXISTS $SB_DATABASE"
case $option in
prepare)
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/test_sb.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
source {{.SandboxDir}}/sb_include
export LD_LIBRARY_PATH=$CLIENT_LD_LIBRARY_PATH
cd $SBDIR
cd "$SBDIR"

fail=0
pass=0
Expand Down
2 changes: 1 addition & 1 deletion sandbox/templates/single/wipe_and_restart.gotxt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{.Copyright}}
# Generated by dbdeployer {{.AppVersion}} using {{.TemplateName}} on {{.DateTime}}
source {{.SandboxDir}}/sb_include
cd $SBDIR
cd "$SBDIR"
if [ -f no_clear ]
then
echo "This sandbox ($(basename $SBDIR)) is locked"
Expand Down

0 comments on commit 05c6d22

Please sign in to comment.