unifi-docker/hotfixes/cve-2021-45046

21 lines
512 B
Bash

#!/usr/bin/env bash
LOG4J_URL=https://downloads.apache.org/logging/log4j/2.16.0/apache-log4j-2.16.0-bin.tar.gz
TMPDIR=$(mktemp -d)
ORIGDIR=$(pwd)
cd "${TMPDIR}" || exit 1
curl -L -o "${TMPDIR}/log4j.tar.gz" "${LOG4J_URL}"
tar --strip=1 -xf log4j.tar.gz
mv log4j-api-2.16.0.jar /usr/lib/unifi/lib/log4j-api-2.15.0.jar
mv log4j-core-2.16.0.jar /usr/lib/unifi/lib/log4j-core-2.15.0.jar
mv log4j-slf4j-impl-2.16.0.jar /usr/lib/unifi/lib/log4j-slf4j-impl-2.15.0.jar
cd "${ORIGDIR}" || exit
rm -rf "${TMPDIR}"