]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: fix params generation for monmaptool 26273/head
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 5 Feb 2019 00:35:20 +0000 (16:35 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 5 Feb 2019 00:41:34 +0000 (16:41 -0800)
Fixes: http://tracker.ceph.com/issues/38174
This broke in the msgr21 case, due to bash globbing in cases where
the generated string somehow matched names of certain files in local
directory. Also need to pass params to the prun function separately,
otherwise everything is quoted together.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/vstart.sh

index c59b0256a5c496d0b5da9a6e2aed6fa503c07ef1..d92d7844d855e1c11d7eb86070274dd7726831d6 100755 (executable)
@@ -680,7 +680,7 @@ start_mon() {
                    "$keyring_fn"
 
                # build a fresh fs monmap, mon fs
-               local str=""
+               local params=()
                local count=0
                local mon_host=""
                for f in $MONS
@@ -694,7 +694,7 @@ start_mon() {
                    if [ $msgr -eq 21 ]; then
                        A="[v2:$IP:$(($CEPH_PORT+$count)),v1:$IP:$(($CEPH_PORT+$count+1))]"
                    fi
-                   str="$str --addv $f $A"
+                   params+=("--addv" "$f" "$A")
                    mon_host="$mon_host $A"
                    wconf <<EOF
 [mon.$f]
@@ -707,7 +707,7 @@ EOF
 [global]
         mon host = $mon_host
 EOF
-               prun "$CEPH_BIN/monmaptool" --create --clobber $str --print "$monmap_fn"
+               prun "$CEPH_BIN/monmaptool" --create --clobber "${params[@]}" --print "$monmap_fn"
 
                for f in $MONS
                do