Skip to content

Commit 46f6df3

Browse files
committed
SOLR-17800: Security Manager should handle symlink on /tmp (#3359)
1 parent da35f09 commit 46f6df3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

solr/CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ Bug Fixes
134134

135135
* SOLR-16667: Fixed dense/sparse representation in LTR module. (Anna Ruggero, Alessandro Benedetti)
136136

137+
* SOLR-17800: Security Manager should handle symlink on /tmp (Kevin Risden)
138+
137139
Dependency Upgrades
138140
---------------------
139141
* SOLR-17471: Upgrade Lucene to 9.12.1. (Pierre Salagnac, Christine Poerschke)

solr/bin/solr

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,10 @@ function jetty_port() {
515515
# useful for doing cross-platform work from the command-line using Java
516516
function run_tool() {
517517

518-
# shellcheck disable=SC2086
518+
# shellcheck disable=SC2086,SC2164
519519
"$JAVA" $SOLR_SSL_OPTS $AUTHC_OPTS ${SOLR_ZK_CREDS_AND_ACLS:-} ${SOLR_TOOL_OPTS:-} -Dsolr.install.dir="$SOLR_TIP" \
520520
-Dlog4j.configurationFile="$DEFAULT_SERVER_DIR/resources/log4j2-console.xml" -Dsolr.pid.dir="$SOLR_PID_DIR" \
521+
-Djava.io.tmpdir="$(cd "${TMPDIR:-${TEMP:-${TMP:-/tmp}}}"; pwd -P)" \
521522
-classpath "$DEFAULT_SERVER_DIR/solr-webapp/webapp/WEB-INF/lib/*:$DEFAULT_SERVER_DIR/lib/ext/*:$DEFAULT_SERVER_DIR/lib/*" \
522523
org.apache.solr.cli.SolrCLI "$@"
523524

@@ -537,8 +538,9 @@ function stop_solr() {
537538

538539
if [ -n "$SOLR_PID" ]; then
539540
echo -e "Sending stop command to Solr running on port $SOLR_PORT ... waiting up to $SOLR_STOP_WAIT seconds to allow Jetty process $SOLR_PID to stop gracefully."
540-
# shellcheck disable=SC2086
541-
"$JAVA" $SOLR_SSL_OPTS $AUTHC_OPTS ${SOLR_TOOL_OPTS:-} -jar "$DIR/start.jar" "STOP.PORT=$THIS_STOP_PORT" "STOP.KEY=$STOP_KEY" --stop || true
541+
# shellcheck disable=SC2086,SC2164
542+
"$JAVA" -Djava.io.tmpdir="$(cd "${TMPDIR:-${TEMP:-${TMP:-/tmp}}}"; pwd -P)" $SOLR_SSL_OPTS $AUTHC_OPTS ${SOLR_TOOL_OPTS:-} \
543+
-jar "$DIR/start.jar" "STOP.PORT=$THIS_STOP_PORT" "STOP.KEY=$STOP_KEY" --stop || true
542544
(loops=0
543545
while true
544546
do
@@ -1403,9 +1405,11 @@ function start_solr() {
14031405
echo "Java $JAVA_VER_NUM detected. Incubating Panama Vector APIs have been enabled"
14041406
fi
14051407

1408+
# shellcheck disable=SC2164
14061409
SOLR_START_OPTS=('-server' "${JAVA_MEM_OPTS[@]}" "${GC_TUNE_ARR[@]}" "${GC_LOG_OPTS[@]}" "${IP_ACL_OPTS[@]}" \
14071410
"${REMOTE_JMX_OPTS[@]}" "${CLOUD_MODE_OPTS[@]}" -Dsolr.log.dir="$SOLR_LOGS_DIR" \
14081411
"-Djetty.port=$SOLR_PORT" "-DSTOP.PORT=$stop_port" "-DSTOP.KEY=$STOP_KEY" \
1412+
"-Djava.io.tmpdir=$(cd "${TMPDIR:-${TEMP:-${TMP:-/tmp}}}"; pwd -P)" \
14091413
# '-OmitStackTraceInFastThrow' ensures stack traces in errors,
14101414
# users who don't care about useful error msgs can override in SOLR_OPTS with +OmitStackTraceInFastThrow
14111415
"${SOLR_HOST_ARG[@]}" "-Duser.timezone=$SOLR_TIMEZONE" "-XX:-OmitStackTraceInFastThrow" \

0 commit comments

Comments
 (0)