This is an automated email from the ASF dual-hosted git repository. xingtanzjr pushed a commit to branch xingtanzjr/fix_code_pattern_to_120 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 00cde50b29295878612e0455b72d8308655c046b Author: Zhang.Jinrui <[email protected]> AuthorDate: Tue Jun 13 14:20:02 2023 +0800 fix a a coding pattern that could possibly have security impact (#10136) --- .../java/org/apache/iotdb/db/conf/directories/TierManager.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/apache/iotdb/db/conf/directories/TierManager.java b/server/src/main/java/org/apache/iotdb/db/conf/directories/TierManager.java index e4dafa2df77..c513d059241 100644 --- a/server/src/main/java/org/apache/iotdb/db/conf/directories/TierManager.java +++ b/server/src/main/java/org/apache/iotdb/db/conf/directories/TierManager.java @@ -220,13 +220,12 @@ public class TierManager { if (!file.exists()) { return getTiersNum() - 1; } - - String filePath; + Path filePath; try { - filePath = file.getCanonicalPath(); + filePath = file.getCanonicalFile().toPath(); } catch (IOException e) { logger.error("Fail to get canonical path of data dir {}", file, e); - filePath = file.getPath(); + filePath = file.toPath(); } for (Map.Entry<String, Integer> entry : seqDir2TierLevel.entrySet()) {
