From 932f537231cba02c9f08558475e6aea5a1c5d838 Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Thu, 16 Dec 2021 07:56:00 +0100 Subject: Update log4j because of the CVE-2021-44228 security flaw --- api/pom.xml | 12 ++++++------ .../main/java/org/openslx/taskmanager/api/AbstractTask.java | 5 +++-- .../main/java/org/openslx/taskmanager/api/Environment.java | 5 +++-- .../java/org/openslx/taskmanager/api/SystemCommandTask.java | 5 +++-- 4 files changed, 15 insertions(+), 12 deletions(-) (limited to 'api') diff --git a/api/pom.xml b/api/pom.xml index 6ff09fb..3993a09 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -48,15 +48,15 @@ - log4j - log4j - 1.2.17 + org.apache.logging.log4j + log4j-api + [2.0,3.0) compile - org.slf4j - slf4j-log4j12 - 1.7.5 + org.apache.logging.log4j + log4j-core + [2.0,3.0) compile diff --git a/api/src/main/java/org/openslx/taskmanager/api/AbstractTask.java b/api/src/main/java/org/openslx/taskmanager/api/AbstractTask.java index 35d179d..43240ce 100644 --- a/api/src/main/java/org/openslx/taskmanager/api/AbstractTask.java +++ b/api/src/main/java/org/openslx/taskmanager/api/AbstractTask.java @@ -2,7 +2,8 @@ package org.openslx.taskmanager.api; import java.util.UUID; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.taskmanager.api.TaskStatus.StatusCode; import com.google.gson.annotations.Expose; @@ -11,7 +12,7 @@ public abstract class AbstractTask implements Runnable { private static final long RELEASE_DELAY = 10l * 60l * 1000l; - private static final Logger LOG = Logger.getLogger( AbstractTask.class ); + private static final Logger LOG = LogManager.getLogger( AbstractTask.class ); /* * To be set from task invocation (json data) diff --git a/api/src/main/java/org/openslx/taskmanager/api/Environment.java b/api/src/main/java/org/openslx/taskmanager/api/Environment.java index 2a33a17..e5705db 100644 --- a/api/src/main/java/org/openslx/taskmanager/api/Environment.java +++ b/api/src/main/java/org/openslx/taskmanager/api/Environment.java @@ -9,7 +9,8 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; /** * Holds the environment that tasks running a system command *should* @@ -18,7 +19,7 @@ import org.apache.log4j.Logger; public class Environment { - private static final Logger log = Logger.getLogger( Environment.class ); + private static final Logger log = LogManager.getLogger( Environment.class ); private static Map env = null; diff --git a/api/src/main/java/org/openslx/taskmanager/api/SystemCommandTask.java b/api/src/main/java/org/openslx/taskmanager/api/SystemCommandTask.java index c1aa6e5..172d2ed 100644 --- a/api/src/main/java/org/openslx/taskmanager/api/SystemCommandTask.java +++ b/api/src/main/java/org/openslx/taskmanager/api/SystemCommandTask.java @@ -8,12 +8,13 @@ import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Map; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public abstract class SystemCommandTask extends AbstractTask { - private static final Logger log = Logger.getLogger( SystemCommandTask.class ); + private static final Logger log = LogManager.getLogger( SystemCommandTask.class ); private String[] command = null; -- cgit v1.2.3-55-g7522