Skip to content

Commit 71c5d7e

Browse files
CaideyipiJackieTien97
authored andcommitted
Pipe: Changed the separator check semantic for pipes / pipe plugins (#17175)
* fix * sep
1 parent 14f264c commit 71c5d7e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

  • integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic
  • iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils

integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/treemodel/auto/basic/IoTDBPipeSyntaxIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public void testInvalidParameter() throws Exception {
335335
public void testDirectoryErrors() throws SQLException {
336336
try (final Connection connection = senderEnv.getConnection();
337337
final Statement statement = connection.createStatement()) {
338-
List<String> wrongDirs = Arrays.asList(".", "..", "./hackYou", ".\\hackYouTwice");
338+
List<String> wrongDirs = Arrays.asList(".", "..", "/hackYou", "..\\hackYouTwice");
339339
if (SystemUtils.IS_OS_WINDOWS) {
340340
wrongDirs = new ArrayList<>(wrongDirs);
341341
wrongDirs.add("BombWindows/:*?");

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/FileUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ private static String copyFileRenameWithMD5(final File sourceFile, final File ta
571571
}
572572

573573
public static String getIllegalError4Directory(final String path) {
574-
if (path.equals(".") || path.equals("..") || path.contains("./") || path.contains(".\\")) {
574+
if (path.equals(".") || path.equals("..") || path.contains("/") || path.contains("\\")) {
575575
return ILLEGAL_PATH_MESSAGE;
576576
}
577577
if (!WindowsOSUtils.isLegalPathSegment4Windows(path)) {

0 commit comments

Comments
 (0)