|
|
@ -32,6 +32,8 @@ import org.apache.dolphinscheduler.remote.command.log.ViewLogResponseCommand; |
|
|
|
import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor; |
|
|
|
import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor; |
|
|
|
import org.apache.dolphinscheduler.remote.utils.Constants; |
|
|
|
import org.apache.dolphinscheduler.remote.utils.Constants; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
import java.io.ByteArrayOutputStream; |
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
import java.io.FileInputStream; |
|
|
|
import java.io.FileInputStream; |
|
|
@ -146,6 +148,9 @@ public class LoggerRequestProcessor implements NettyRequestProcessor { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private boolean checkPathSecurity(String path) { |
|
|
|
private boolean checkPathSecurity(String path) { |
|
|
|
String dsHome = System.getProperty("DOLPHINSCHEDULER_WORKER_HOME"); |
|
|
|
String dsHome = System.getProperty("DOLPHINSCHEDULER_WORKER_HOME"); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(dsHome)) { |
|
|
|
|
|
|
|
dsHome = System.getProperty("user.dir"); |
|
|
|
|
|
|
|
} |
|
|
|
if (path.startsWith(dsHome) && !path.contains("../") && path.endsWith(".log")) { |
|
|
|
if (path.startsWith(dsHome) && !path.contains("../") && path.endsWith(".log")) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|