Browse Source

Fix log and config file read (#8884)

2.0.7-release
gaojun2048 3 years ago committed by GitHub
parent
commit
9717da6c25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java

10
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;
}

Loading…
Cancel
Save