HoustonPutman commented on a change in pull request #1861:
URL: https://github.com/apache/lucene-solr/pull/1861#discussion_r489445830



##########
File path: 
solr/core/src/java/org/apache/solr/handler/admin/ConfigSetsHandler.java
##########
@@ -170,21 +176,90 @@ private void handleConfigUploadRequest(SolrQueryRequest 
req, SolrQueryResponse r
 
     // Create a node for the configuration in zookeeper
     boolean trusted = getTrusted(req);
-    zkClient.makePath(configPathInZk, ("{\"trusted\": " + 
Boolean.toString(trusted) + "}").
-        getBytes(StandardCharsets.UTF_8), true);
+    Set<String> filesToDelete = Collections.emptySet();
+    if (overwritesExisting) {
+      if (!trusted) {
+        ensureOverwritingUntrustedConfigSet(zkClient, configPathInZk);
+      }
+      if (req.getParams().getBool(ConfigSetParams.CLEANUP, false)) {
+        filesToDelete = getAllConfigsetFiles(zkClient, configPathInZk);
+      }
+    } else {

Review comment:
       Yeah, for example if you want to use plugins or something similar, I 
could see someone not using a trusted configSet at first, but then wanting to 
overwrite their configSet to be "trusted" to be able to use the plugins.
   
   I don't see why that shouldn't be possible, given that there's little 
difference security-wise between creating a new config set and overwriting w/ 
cleanup.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to