You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ga...@apache.org on 2022/03/14 15:37:12 UTC

[dolphinscheduler] branch 2.0.6-prepare updated: Fix log and config file read (#8884)

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

gaojun2048 pushed a commit to branch 2.0.6-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/2.0.6-prepare by this push:
     new 9717da6  Fix log and config file read (#8884)
9717da6 is described below

commit 9717da6c255414eaef1c9ac943b0eb8989c1a85d
Author: gaojun2048 <ga...@gmail.com>
AuthorDate: Mon Mar 14 23:33:17 2022 +0800

    Fix log and config file read (#8884)
---
 .../dolphinscheduler/server/log/LoggerRequestProcessor.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
index 7115e24..b56037e 100644
--- a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
+++ b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
@@ -46,6 +46,7 @@ import java.util.concurrent.Executors;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import org.apache.dolphinscheduler.spi.utils.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -141,10 +142,13 @@ public class LoggerRequestProcessor implements NettyRequestProcessor {
 
     private boolean checkPathSecurity(String path) {
         String dsHome = System.getProperty("DOLPHINSCHEDULER_HOME");
-        if (path.startsWith(dsHome) && !path.contains("../") && path.endsWith(".log")) {
-            return true;
+        if (!StringUtils.isBlank(path)) {
+            if (path.startsWith(dsHome) && !path.contains("../") && path.endsWith(".log")) {
+                return true;
+            }
+        } else {
+            logger.warn("path is null");
         }
-
         return false;
     }