mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Merge pull request #17496 from jasontedor/eval-with-spaces
Quote path to java binary
This commit is contained in:
commit
d113e1fc97
@ -110,4 +110,4 @@ fi
|
||||
HOSTNAME=`hostname | cut -d. -f1`
|
||||
export HOSTNAME
|
||||
|
||||
eval "$JAVA" -client -Delasticsearch -Des.path.home="\"$ES_HOME\"" $properties -cp "\"$ES_HOME/lib/*\"" org.elasticsearch.plugins.PluginCli $args
|
||||
eval "\"$JAVA\"" -client -Delasticsearch -Des.path.home="\"$ES_HOME\"" $properties -cp "\"$ES_HOME/lib/*\"" org.elasticsearch.plugins.PluginCli $args
|
||||
|
@ -455,3 +455,24 @@ fi
|
||||
fi
|
||||
remove_jvm_example
|
||||
}
|
||||
|
||||
@test "[$GROUP] test java home with space" {
|
||||
# preserve JAVA_HOME
|
||||
local java_home=$JAVA_HOME
|
||||
|
||||
# create a JAVA_HOME with a space
|
||||
local java=$(which java)
|
||||
local temp=`mktemp -d --suffix="java home"`
|
||||
mkdir -p "$temp/bin"
|
||||
ln -s "$java" "$temp/bin/java"
|
||||
export JAVA_HOME="$temp"
|
||||
|
||||
# this will fail if the elasticsearch-plugin script does not
|
||||
# properly handle JAVA_HOME with spaces
|
||||
"$ESHOME/bin/elasticsearch-plugin" list
|
||||
|
||||
rm -rf "$temp"
|
||||
|
||||
# restore JAVA_HOME
|
||||
export JAVA_HOME=$java_home
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user