diff --git a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java index 844477b6590b6..6ae8d56bfaa5c 100644 --- a/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java @@ -342,7 +342,7 @@ public void testInvalidParameter() throws Exception { public void testDirectoryErrors() throws SQLException { try (final Connection connection = senderEnv.getConnection(); final Statement statement = connection.createStatement()) { - List wrongDirs = Arrays.asList(".", "..", "./hackYou", ".\\hackYouTwice"); + List wrongDirs = Arrays.asList(".", "..", "/hackYou", "..\\hackYouTwice"); if (SystemUtils.IS_OS_WINDOWS) { wrongDirs = new ArrayList<>(wrongDirs); wrongDirs.add("BombWindows/:*?"); diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java index 595cd5e831c69..139d08ef99b0d 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java @@ -583,7 +583,7 @@ private static void copyFileRename(final File sourceFile, final File targetFile) } public static String getIllegalError4Directory(final String path) { - if (path.equals(".") || path.equals("..") || path.contains("./") || path.contains(".\\")) { + if (path.equals(".") || path.equals("..") || path.contains("/") || path.contains("\\")) { return ILLEGAL_PATH_MESSAGE; } if (!WindowsOSUtils.isLegalPathSegment4Windows(path)) {