NazerkeBS commented on code in PR #146:
URL: https://github.com/apache/solr/pull/146#discussion_r1041139201


##########
solr/core/src/java/org/apache/solr/core/FileSystemConfigSetService.java:
##########
@@ -287,9 +287,11 @@ public Long getCurrentSchemaModificationVersion(
   }
 
   protected Path getConfigDir(String configName) throws IOException {
-    String configSetDirPath = configSetBase.toFile().getCanonicalPath() + 
File.separator;
-    String path = Paths.get(configSetBase.toString(), 
configName).toFile().getCanonicalPath();
-    if (!path.startsWith(configSetDirPath)) {
+    String path =
+        Paths.get(configSetBase.toString(), FilenameUtils.getName(configName))
+            .toFile()
+            .getCanonicalPath();

Review Comment:
   to remove intermediate `.` or `..` from absolute Path.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

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


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

Reply via email to