tflobbe commented on a change in pull request #1861:
URL: https://github.com/apache/lucene-solr/pull/1861#discussion_r489001572
##########
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:
As it currently stands, an overwrite never updates the "trusted" flag,
if it wasn't trusted before, it'll continue to be untrusted after the upgrade.
If it was trusted, only an authenticated request would be allowed. I see your
point that if "cleanup" is set to "true", an authenticated request could turn
the configset to trusted, is that what you are suggesting?
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]