Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-11482: RunExecutableListener was removed for security reasons

Uwe Schindler7b313bb597a6
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 9101440c703..28fea4e47b5 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -96,6 +96,10 @@ Upgrade Notes
* SOLR-10962: in the ReplicationHandler the master.commitReserveDuration sub-element is deprecated. Instead
please configure a direct commitReserveDuration element for use in all modes (master, slave, cloud).
+* SOLR-11482: RunExecutableListener was removed for security reasons. If you want to listen to
+ events caused by updates, commits, or optimize, write your own listener as native Java class
+ as part of a Solr plugin.
+
New Features
----------------------
* SOLR-10339: New set-trigger and remove-trigger APIs for autoscaling. (shalin)
@@ -368,6 +372,9 @@ Other Changes
* SOLR-11306: Fix inaccurate comments on docValues and StrField in the example schemas
(Tom Burton-West, Jason Gerlowski, Varun Thacker)
+* SOLR-11482: RunExecutableListener was removed for security reasons. (Michael Stepankin,
+ Olga Barinova, Uwe Schindler, Tomás Fernández Löbbe)
+
================== 7.0.1 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
diff --git a/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/solrconfig.xml b/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/solrconfig.xml
index 8d0f82e5bed..5ff42541ed4 100644
--- a/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/solrconfig.xml
+++ b/solr/contrib/clustering/src/test-files/clustering/solr/collection1/conf/solrconfig.xml
@@ -63,31 +63,6 @@
</autoCommit>
-->
- <!-- The RunExecutableListener executes an external command.
- exe - the name of the executable to run
- dir - dir to use as the current working directory. default="."
- wait - the calling thread waits until the executable returns. default="true"
- args - the arguments to pass to the program. default=nothing
- env - environment variables to set. default=nothing
- -->
- <!-- A postCommit event is fired after every commit or optimize command
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
- <!-- A postOptimize event is fired only after every optimize command, useful
- in conjunction with index distribution to only distribute optimized indicies
- <listener event="postOptimize" class="solr.RunExecutableListener">
- <str name="exe">snapshooter</str>
- <str name="dir">solr/bin</str>
- <bool name="wait">true</bool>
- </listener>
- -->
-
</updateHandler>
diff --git a/solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/solrconfig.xml b/solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/solrconfig.xml
index 4dbf0828a6a..faffeb82789 100644
--- a/solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/solrconfig.xml
+++ b/solr/contrib/extraction/src/test-files/extraction/solr/collection1/conf/solrconfig.xml
@@ -40,24 +40,6 @@
</autoCommit>
-->
- <!-- The RunExecutableListener executes an external command.
- exe - the name of the executable to run
- dir - dir to use as the current working directory. default="."
- wait - the calling thread waits until the executable returns. default="true"
- args - the arguments to pass to the program. default=nothing
- env - environment variables to set. default=nothing
- -->
- <!-- A postCommit event is fired after every commit
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">/var/opt/resin3/__PORT__/scripts/solr/snapshooter</str>
- <str name="dir">/var/opt/resin3/__PORT__</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
-
-
</updateHandler>
diff --git a/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/solrconfig.xml b/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/solrconfig.xml
index 96392d3f9e0..776de398cad 100644
--- a/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/solrconfig.xml
+++ b/solr/contrib/uima/src/test-files/uima/solr/collection1/conf/solrconfig.xml
@@ -101,31 +101,6 @@
</autoCommit>
-->
-
- <!--
- The RunExecutableListener executes an external command from a hook
- such as postCommit or postOptimize. exe - the name of the
- executable to run dir - dir to use as the current working
- directory. default="." wait - the calling thread waits until the
- executable returns. default="true" args - the arguments to pass to
- the program. default=nothing env - environment variables to set.
- default=nothing
- -->
- <!--
- A postCommit event is fired after every commit or optimize command
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str> <str name="dir">.</str>
- <bool name="wait">true</bool> <arr name="args"> <str>arg1</str>
- <str>arg2</str> </arr> <arr name="env"> <str>MYVAR=val1</str>
- </arr> </listener>
- -->
- <!--
- A postOptimize event is fired only after every optimize command
- <listener event="postOptimize" class="solr.RunExecutableListener">
- <str name="exe">snapshooter</str> <str name="dir">solr/bin</str>
- <bool name="wait">true</bool> </listener>
- -->
-
</updateHandler>
<!--
diff --git a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml
index df7dc1eed4d..55cd3fa8bfe 100644
--- a/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml
+++ b/solr/contrib/uima/src/test-files/uima/uima-tokenizers-solrconfig.xml
@@ -99,32 +99,7 @@
<autoCommit> <maxDocs>10000</maxDocs> <maxTime>1000</maxTime>
</autoCommit>
-->
-
-
- <!--
- The RunExecutableListener executes an external command from a hook
- such as postCommit or postOptimize. exe - the name of the
- executable to run dir - dir to use as the current working
- directory. default="." wait - the calling thread waits until the
- executable returns. default="true" args - the arguments to pass to
- the program. default=nothing env - environment variables to set.
- default=nothing
- -->
- <!--
- A postCommit event is fired after every commit or optimize command
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str> <str name="dir">.</str>
- <bool name="wait">true</bool> <arr name="args"> <str>arg1</str>
- <str>arg2</str> </arr> <arr name="env"> <str>MYVAR=val1</str>
- </arr> </listener>
- -->
- <!--
- A postOptimize event is fired only after every optimize command
- <listener event="postOptimize" class="solr.RunExecutableListener">
- <str name="exe">snapshooter</str> <str name="dir">solr/bin</str>
- <bool name="wait">true</bool> </listener>
- -->
-
+
</updateHandler>
<!--
diff --git a/solr/core/src/java/org/apache/solr/core/RunExecutableListener.java b/solr/core/src/java/org/apache/solr/core/RunExecutableListener.java
deleted file mode 100644
index c6d0090fe37..00000000000
--- a/solr/core/src/java/org/apache/solr/core/RunExecutableListener.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.core;
-
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SolrException.ErrorCode;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.search.SolrIndexSearcher;
-import org.apache.solr.util.plugin.SolrCoreAware;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- */
-class RunExecutableListener extends AbstractSolrEventListener implements SolrCoreAware {
- private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
- public RunExecutableListener(SolrCore core) {
- super(core);
- }
- protected String[] cmd;
- protected File dir;
- protected String[] envp;
- protected boolean wait=true;
-
- @Override
- public void init(NamedList args) {
- super.init(args);
-
- List cmdlist = new ArrayList();
- cmdlist.add(args.get("exe"));
- List lst = (List)args.get("args");
- if (lst != null) cmdlist.addAll(lst);
- cmd = (String[])cmdlist.toArray(new String[cmdlist.size()]);
-
- lst = (List)args.get("env");
- if (lst != null) {
- envp = (String[])lst.toArray(new String[lst.size()]);
- }
-
- String str = (String)args.get("dir");
- if (str==null || str.equals("") || str.equals(".") || str.equals("./")) {
- dir = null;
- } else {
- dir = new File(str);
- }
-
- if ("false".equals(args.get("wait")) || Boolean.FALSE.equals(args.get("wait"))) wait=false;
- }
-
- @Override
- public void inform(SolrCore core) {
- if (!core.getCoreDescriptor().isConfigSetTrusted()) {
- throw new SolrException(ErrorCode.UNAUTHORIZED, "The configset for this collection was uploaded without any authentication in place,"
- + " and this operation is not available for collections with untrusted configsets. To have this component, re-upload the configset"
- + " after enabling authentication and authorization.");
- }
- }
-
- /**
- * External executable listener.
- *
- * @param callback Unused (As of solr 1.4-dev)
- * @return Error code indicating if the command has executed successfully. <br />
- * 0 , indicates normal termination.<br />
- * non-zero , otherwise.
- */
- protected int exec(String callback) {
- int ret = 0;
-
- try {
- boolean doLog = log.isDebugEnabled();
- if (doLog) {
- log.debug("About to exec " + cmd[0]);
- }
- final Process proc;
- try {
- proc = Runtime.getRuntime().exec(cmd, envp ,dir);
- } catch (Error err) {
- // Create better error message
- if (err.getMessage() != null && (err.getMessage().contains("posix_spawn") || err.getMessage().contains("UNIXProcess"))) {
- Error newErr = new Error("Error forking command due to JVM locale bug (see https://issues.apache.org/jira/browse/SOLR-6387): " + err.getMessage());
- newErr.setStackTrace(err.getStackTrace());
- err = newErr;
- }
- throw err;
- }
-
- if (wait) {
- try {
- ret = proc.waitFor();
- } catch (InterruptedException e) {
- SolrException.log(log,e);
- ret = INVALID_PROCESS_RETURN_CODE;
- }
- }
-
- if (wait && doLog) {
- log.debug("Executable " + cmd[0] + " returned " + ret);
- }
-
- } catch (IOException e) {
- // don't throw exception, just log it...
- SolrException.log(log,e);
- ret = INVALID_PROCESS_RETURN_CODE;
- }
-
- return ret;
- }
-
-
- @Override
- public void postCommit() {
- // anything generic need to be passed to the external program?
- // the directory of the index? the command that caused it to be
- // invoked? the version of the index?
- exec("postCommit");
- }
-
- @Override
- public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher) {
- exec("newSearcher");
- }
-
- /** Non-zero value for an invalid return code **/
- private static int INVALID_PROCESS_RETURN_CODE = -1;
-
-}
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-analytics-query.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-analytics-query.xml
index fc33e46a38d..b967c0deb19 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-analytics-query.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-analytics-query.xml
@@ -62,23 +62,6 @@
</autoCommit>
-->
- <!-- The RunExecutableListener executes an external command.
- exe - the name of the executable to run
- dir - dir to use as the current working directory. default="."
- wait - the calling thread waits until the executable returns. default="true"
- args - the arguments to pass to the program. default=nothing
- env - environment variables to set. default=nothing
- -->
- <!-- A postCommit event is fired after every commit
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">/var/opt/resin3/__PORT__/scripts/solr/snapshooter</str>
- <str name="dir">/var/opt/resin3/__PORT__</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
-
<updateLog enable="${enable.update.log:true}">
<str name="dir">${solr.ulog.dir:}</str>
</updateLog>
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml
index 65820e04022..1edaa865ab8 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-collapseqparser.xml
@@ -62,23 +62,6 @@
</autoCommit>
-->
- <!-- The RunExecutableListener executes an external command.
- exe - the name of the executable to run
- dir - dir to use as the current working directory. default="."
- wait - the calling thread waits until the executable returns. default="true"
- args - the arguments to pass to the program. default=nothing
- env - environment variables to set. default=nothing
- -->
- <!-- A postCommit event is fired after every commit
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">/var/opt/resin3/__PORT__/scripts/solr/snapshooter</str>
- <str name="dir">/var/opt/resin3/__PORT__</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
-
<updateLog enable="${enable.update.log:true}">
<str name="dir">${solr.ulog.dir:}</str>
</updateLog>
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml
index 083333cf6b5..1c8e10fd07b 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-elevate.xml
@@ -43,23 +43,6 @@
</autoCommit>
-->
- <!-- The RunExecutableListener executes an external command.
- exe - the name of the executable to run
- dir - dir to use as the current working directory. default="."
- wait - the calling thread waits until the executable returns. default="true"
- args - the arguments to pass to the program. default=nothing
- env - environment variables to set. default=nothing
- -->
- <!-- A postCommit event is fired after every commit
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">/var/opt/resin3/__PORT__/scripts/solr/snapshooter</str>
- <str name="dir">/var/opt/resin3/__PORT__</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
-
</updateHandler>
<query>
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml
index 431447ceb65..25071a51946 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-plugcollector.xml
@@ -60,22 +60,6 @@
<maxTime>3600000</maxTime>
</autoCommit>
-->
- <!-- The RunExecutableListener executes an external command.
- exe - the name of the executable to run
- dir - dir to use as the current working directory. default="."
- wait - the calling thread waits until the executable returns. default="true"
- args - the arguments to pass to the program. default=nothing
- env - environment variables to set. default=nothing
- -->
- <!-- A postCommit event is fired after every commit
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">/var/opt/resin3/__PORT__/scripts/solr/snapshooter</str>
- <str name="dir">/var/opt/resin3/__PORT__</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
<updateLog enable="${enable.update.log:true}">
<str name="dir">${solr.ulog.dir:}</str>
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
index 6528abad706..3393f9f5ad8 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
@@ -73,23 +73,6 @@
<maxTime>3600000</maxTime>
</autoCommit>
-->
-
- <!-- The RunExecutableListener executes an external command.
- exe - the name of the executable to run
- dir - dir to use as the current working directory. default="."
- wait - the calling thread waits until the executable returns. default="true"
- args - the arguments to pass to the program. default=nothing
- env - environment variables to set. default=nothing
- -->
- <!-- A postCommit event is fired after every commit
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">/var/opt/resin3/__PORT__/scripts/solr/snapshooter</str>
- <str name="dir">/var/opt/resin3/__PORT__</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
<updateLog enable="${enable.update.log:true}">
<str name="dir">${solr.ulog.dir:}</str>
diff --git a/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml b/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml
index 3b110820705..49f3a38e65d 100644
--- a/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml
+++ b/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml
@@ -331,29 +331,6 @@
postCommit - fired after every commit or optimize command
postOptimize - fired after every optimize command
-->
- <!-- The RunExecutableListener executes an external command from a
- hook such as postCommit or postOptimize.
-
- exe - the name of the executable to run
- dir - dir to use as the current working directory. (default=".")
- wait - the calling thread waits until the executable returns.
- (default="true")
- args - the arguments to pass to the program. (default is none)
- env - environment variables to set. (default is none)
- -->
- <!-- This example shows how RunExecutableListener could be used
- with the script based replication...
- http://wiki.apache.org/solr/CollectionDistribution
- -->
- <!--
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
</updateHandler>
diff --git a/solr/core/src/test-files/solr/configsets/upload/with-run-executable-listener/managed-schema b/solr/core/src/test-files/solr/configsets/upload/with-run-executable-listener/managed-schema
deleted file mode 100644
index 9e2f9471026..00000000000
--- a/solr/core/src/test-files/solr/configsets/upload/with-run-executable-listener/managed-schema
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<schema name="minimal" version="1.1">
- <types>
- <fieldType name="string" class="solr.StrField"/>
- </types>
- <fields>
- <dynamicField name="*" type="string" indexed="true" stored="true" />
- </fields>
-</schema>
diff --git a/solr/core/src/test-files/solr/configsets/upload/with-run-executable-listener/solrconfig.xml b/solr/core/src/test-files/solr/configsets/upload/with-run-executable-listener/solrconfig.xml
deleted file mode 100644
index 46838416c41..00000000000
--- a/solr/core/src/test-files/solr/configsets/upload/with-run-executable-listener/solrconfig.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" ?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- This is a "kitchen sink" config file that tests can use.
- When writting a new test, feel free to add *new* items (plugins,
- config options, etc...) as long as they don't break any existing
- tests. if you need to test something esoteric please add a new
- "solrconfig-your-esoteric-purpose.xml" config file.
-
- Note in particular that this test is used by MinimalSchemaTest so
- Anything added to this file needs to work correctly even if there
- is now uniqueKey or defaultSearch Field.
- -->
-
-<config>
-
- <dataDir>${solr.data.dir:}</dataDir>
-
- <directoryFactory name="DirectoryFactory"
- class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
-
- <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
-
- <updateHandler class="solr.DirectUpdateHandler2">
- <commitWithin>
- <softCommit>${solr.commitwithin.softcommit:true}</softCommit>
- </commitWithin>
-
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">/var/opt/resin3/__PORT__/scripts/solr/snapshooter</str>
- <str name="dir">/var/opt/resin3/__PORT__</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
-
- </updateHandler>
- <requestHandler name="/select" class="solr.SearchHandler">
- <lst name="defaults">
- <str name="echoParams">explicit</str>
- <str name="indent">true</str>
- <str name="df">text</str>
- </lst>
-
- </requestHandler>
-
- <requestHandler name="/update/xslt"
- startup="lazy"
- class="solr.XsltUpdateRequestHandler"/>
-
- <requestHandler name="/update" class="solr.UpdateRequestHandler" />
-</config>
-
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
index d59b6eae2b1..374e27a0e1c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
@@ -327,18 +327,6 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
createCollection("newcollection", "regular" + suffix, 1, 1, solrCluster.getSolrClient());
}
- @Test
- public void testUploadWithRunExecutableListener() throws Exception {
- String suffix = "-untrusted";
- uploadConfigSet("with-run-executable-listener", suffix, null, null);
- // try to create a collection with the uploaded configset
- CollectionAdminResponse resp = createCollection("newcollection3", "with-run-executable-listener" + suffix, 1, 1, solrCluster.getSolrClient());
- log.info("Client saw errors: "+resp.getErrorMessages());
- assertTrue(resp.getErrorMessages() != null && resp.getErrorMessages().size() > 0);
- assertTrue(resp.getErrorMessages().getVal(0).
- contains("The configset for this collection was uploaded without any authentication"));
- }
-
@Test
public void testUploadWithScriptUpdateProcessor() throws Exception {
for (boolean withAuthorization: Arrays.asList(false, true)) {
diff --git a/solr/example/example-DIH/solr/db/conf/solrconfig.xml b/solr/example/example-DIH/solr/db/conf/solrconfig.xml
index 6b53a95d8c9..1ffbbe817f8 100644
--- a/solr/example/example-DIH/solr/db/conf/solrconfig.xml
+++ b/solr/example/example-DIH/solr/db/conf/solrconfig.xml
@@ -321,29 +321,6 @@
postCommit - fired after every commit or optimize command
postOptimize - fired after every optimize command
-->
- <!-- The RunExecutableListener executes an external command from a
- hook such as postCommit or postOptimize.
-
- exe - the name of the executable to run
- dir - dir to use as the current working directory. (default=".")
- wait - the calling thread waits until the executable returns.
- (default="true")
- args - the arguments to pass to the program. (default is none)
- env - environment variables to set. (default is none)
- -->
- <!-- This example shows how RunExecutableListener could be used
- with the script based replication...
- http://wiki.apache.org/solr/CollectionDistribution
- -->
- <!--
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
</updateHandler>
diff --git a/solr/example/example-DIH/solr/mail/conf/solrconfig.xml b/solr/example/example-DIH/solr/mail/conf/solrconfig.xml
index ba7f2e1c164..770b0fd870d 100644
--- a/solr/example/example-DIH/solr/mail/conf/solrconfig.xml
+++ b/solr/example/example-DIH/solr/mail/conf/solrconfig.xml
@@ -324,29 +324,6 @@
postCommit - fired after every commit or optimize command
postOptimize - fired after every optimize command
-->
- <!-- The RunExecutableListener executes an external command from a
- hook such as postCommit or postOptimize.
-
- exe - the name of the executable to run
- dir - dir to use as the current working directory. (default=".")
- wait - the calling thread waits until the executable returns.
- (default="true")
- args - the arguments to pass to the program. (default is none)
- env - environment variables to set. (default is none)
- -->
- <!-- This example shows how RunExecutableListener could be used
- with the script based replication...
- http://wiki.apache.org/solr/CollectionDistribution
- -->
- <!--
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
</updateHandler>
diff --git a/solr/example/example-DIH/solr/solr/conf/solrconfig.xml b/solr/example/example-DIH/solr/solr/conf/solrconfig.xml
index 745e57597d2..3f00141340f 100644
--- a/solr/example/example-DIH/solr/solr/conf/solrconfig.xml
+++ b/solr/example/example-DIH/solr/solr/conf/solrconfig.xml
@@ -321,29 +321,6 @@
postCommit - fired after every commit or optimize command
postOptimize - fired after every optimize command
-->
- <!-- The RunExecutableListener executes an external command from a
- hook such as postCommit or postOptimize.
-
- exe - the name of the executable to run
- dir - dir to use as the current working directory. (default=".")
- wait - the calling thread waits until the executable returns.
- (default="true")
- args - the arguments to pass to the program. (default is none)
- env - environment variables to set. (default is none)
- -->
- <!-- This example shows how RunExecutableListener could be used
- with the script based replication...
- http://wiki.apache.org/solr/CollectionDistribution
- -->
- <!--
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
</updateHandler>
diff --git a/solr/example/files/conf/solrconfig.xml b/solr/example/files/conf/solrconfig.xml
index 748bd0f221e..bca0df80286 100644
--- a/solr/example/files/conf/solrconfig.xml
+++ b/solr/example/files/conf/solrconfig.xml
@@ -322,29 +322,6 @@
postCommit - fired after every commit or optimize command
postOptimize - fired after every optimize command
-->
- <!-- The RunExecutableListener executes an external command from a
- hook such as postCommit or postOptimize.
-
- exe - the name of the executable to run
- dir - dir to use as the current working directory. (default=".")
- wait - the calling thread waits until the executable returns.
- (default="true")
- args - the arguments to pass to the program. (default is none)
- env - environment variables to set. (default is none)
- -->
- <!-- This example shows how RunExecutableListener could be used
- with the script based replication...
- http://wiki.apache.org/solr/CollectionDistribution
- -->
- <!--
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
</updateHandler>
diff --git a/solr/server/solr/configsets/_default/conf/solrconfig.xml b/solr/server/solr/configsets/_default/conf/solrconfig.xml
index 3b110820705..49f3a38e65d 100644
--- a/solr/server/solr/configsets/_default/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/_default/conf/solrconfig.xml
@@ -331,29 +331,6 @@
postCommit - fired after every commit or optimize command
postOptimize - fired after every optimize command
-->
- <!-- The RunExecutableListener executes an external command from a
- hook such as postCommit or postOptimize.
-
- exe - the name of the executable to run
- dir - dir to use as the current working directory. (default=".")
- wait - the calling thread waits until the executable returns.
- (default="true")
- args - the arguments to pass to the program. (default is none)
- env - environment variables to set. (default is none)
- -->
- <!-- This example shows how RunExecutableListener could be used
- with the script based replication...
- http://wiki.apache.org/solr/CollectionDistribution
- -->
- <!--
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
</updateHandler>
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
index 65750c24e0a..6fc1bd2ba6c 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
@@ -336,29 +336,6 @@
postCommit - fired after every commit or optimize command
postOptimize - fired after every optimize command
-->
- <!-- The RunExecutableListener executes an external command from a
- hook such as postCommit or postOptimize.
-
- exe - the name of the executable to run
- dir - dir to use as the current working directory. (default=".")
- wait - the calling thread waits until the executable returns.
- (default="true")
- args - the arguments to pass to the program. (default is none)
- env - environment variables to set. (default is none)
- -->
- <!-- This example shows how RunExecutableListener could be used
- with the script based replication...
- http://wiki.apache.org/solr/CollectionDistribution
- -->
- <!--
- <listener event="postCommit" class="solr.RunExecutableListener">
- <str name="exe">solr/bin/snapshooter</str>
- <str name="dir">.</str>
- <bool name="wait">true</bool>
- <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
- <arr name="env"> <str>MYVAR=val1</str> </arr>
- </listener>
- -->
</updateHandler>
diff --git a/solr/solr-ref-guide/src/configsets-api.adoc b/solr/solr-ref-guide/src/configsets-api.adoc
index ee4f24cb5c1..ef67781e033 100644
--- a/solr/solr-ref-guide/src/configsets-api.adoc
+++ b/solr/solr-ref-guide/src/configsets-api.adoc
@@ -155,7 +155,6 @@ http://localhost:8983/solr/admin/configs?action=LIST
Upload a ConfigSet, sent in as a zipped file. Please note that a ConfigSet is uploaded in a "trusted" mode if authentication is enabled and this upload operation is performed as an authenticated request. Without authentication, a ConfigSet is uploaded in an "untrusted" mode. Upon creation of a collection using an "untrusted" ConfigSet, the following functionality would not work:
- * RunExecutableListener does not initialize, if specified in the ConfigSet.
* DataImportHandler's ScriptTransformer does not initialize, if specified in the ConfigSet.
* XSLT transformer (tr parameter) cannot be used at request processing time.
* StatelessScriptUpdateProcessor does not initialize, if specified in the ConfigSet.
diff --git a/solr/solr-ref-guide/src/updatehandlers-in-solrconfig.adoc b/solr/solr-ref-guide/src/updatehandlers-in-solrconfig.adoc
index 1d0a5cf0b5f..082ccf988da 100644
--- a/solr/solr-ref-guide/src/updatehandlers-in-solrconfig.adoc
+++ b/solr/solr-ref-guide/src/updatehandlers-in-solrconfig.adoc
@@ -91,22 +91,8 @@ With this configuration, when you call `commitWithin` as part of your update mes
The UpdateHandler section is also where update-related event listeners can be configured. These can be triggered to occur after any commit (`event="postCommit"`) or only after optimize commands (`event="postOptimize"`).
-Users can write custom update event listener classes, but a common use case is to run external executables via the `RunExecutableListener`:
-
-`exe`::
-The name of the executable to run. It should include the path to the file, relative to Solr home.
-
-`dir`::
-The directory to use as the working directory. The default is the current directory (".").
-
-`wait`::
-Forces the calling thread to wait until the executable returns a response. The default is `true`.
-
-`args`::
-Any arguments to pass to the program. The default is none.
-
-`env`::
-Any environment variables to set. The default is none.
+Users can write custom update event listener classes in Solr plugins. As of Solr 7.1,
+`RunExecutableListener` was removed for security reasons.
== Transaction Log