You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2023/06/13 06:21:45 UTC

[iotdb] branch xingtanzjr/fix_code_pattern_to_120 created (now 00cde50b292)

This is an automated email from the ASF dual-hosted git repository.

xingtanzjr pushed a change to branch xingtanzjr/fix_code_pattern_to_120
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 00cde50b292 fix a  a coding pattern that could possibly have security impact (#10136)

This branch includes the following new commits:

     new 00cde50b292 fix a  a coding pattern that could possibly have security impact (#10136)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: fix a a coding pattern that could possibly have security impact (#10136)

Posted by xi...@apache.org.
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 <xi...@gmail.com>
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()) {