Skip to content

Commit e759c15

Browse files
authored
SOLR-17800: Security Manager should handle symlink on /tmp (#3359)
1 parent ba981cd commit e759c15

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
@@ -329,6 +329,8 @@ Bug Fixes
329329

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

332+
* SOLR-17800: Security Manager should handle symlink on /tmp (Kevin Risden)
333+
332334
Dependency Upgrades
333335
---------------------
334336
* 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
@@ -495,9 +495,10 @@ function jetty_port() {
495495
# useful for doing cross-platform work from the command-line using Java
496496
function run_tool() {
497497

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

@@ -517,8 +518,9 @@ function stop_solr() {
517518

518519
if [ -n "$SOLR_PID" ]; then
519520
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."
520-
# shellcheck disable=SC2086
521-
"$JAVA" $SOLR_SSL_OPTS $AUTHC_OPTS ${SOLR_TOOL_OPTS:-} -jar "$DIR/start.jar" "STOP.PORT=$THIS_STOP_PORT" "STOP.KEY=$STOP_KEY" --stop || true
521+
# shellcheck disable=SC2086,SC2164
522+
"$JAVA" -Djava.io.tmpdir="$(cd "${TMPDIR:-${TEMP:-${TMP:-/tmp}}}"; pwd -P)" $SOLR_SSL_OPTS $AUTHC_OPTS ${SOLR_TOOL_OPTS:-} \
523+
-jar "$DIR/start.jar" "STOP.PORT=$THIS_STOP_PORT" "STOP.KEY=$STOP_KEY" --stop || true
522524
(loops=0
523525
while true
524526
do
@@ -1311,9 +1313,11 @@ function start_solr() {
13111313
# Add vector optimizations module
13121314
SCRIPT_SOLR_OPTS+=("--add-modules" "jdk.incubator.vector")
13131315

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

0 commit comments

Comments
 (0)