mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
package/fail2ban: drop python2 support
Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
committed by
Yann E. MORIN
parent
8af1b5df85
commit
109ff80fc1
@@ -1,6 +1,6 @@
|
|||||||
config BR2_PACKAGE_FAIL2BAN
|
config BR2_PACKAGE_FAIL2BAN
|
||||||
bool "fail2ban"
|
bool "fail2ban"
|
||||||
depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
|
depends on BR2_PACKAGE_PYTHON3
|
||||||
select BR2_PACKAGE_PYTHON_SYSTEMD if BR2_PACKAGE_SYSTEMD
|
select BR2_PACKAGE_PYTHON_SYSTEMD if BR2_PACKAGE_SYSTEMD
|
||||||
help
|
help
|
||||||
Fail2ban scans log files (e.g. /var/log/apache/error_log) and
|
Fail2ban scans log files (e.g. /var/log/apache/error_log) and
|
||||||
|
|||||||
@@ -15,15 +15,13 @@ FAIL2BAN_SETUP_TYPE = distutils
|
|||||||
# 0001-fixed-possible-RCE-vulnerability-unset-escape-variable.patch
|
# 0001-fixed-possible-RCE-vulnerability-unset-escape-variable.patch
|
||||||
FAIL2BAN_IGNORE_CVES += CVE-2021-32749
|
FAIL2BAN_IGNORE_CVES += CVE-2021-32749
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_PYTHON3),y)
|
|
||||||
define FAIL2BAN_PYTHON_2TO3
|
define FAIL2BAN_PYTHON_2TO3
|
||||||
$(HOST_DIR)/bin/2to3 --write --nobackups --no-diffs $(@D)/bin/* $(@D)/fail2ban
|
$(HOST_DIR)/bin/2to3 --write --nobackups --no-diffs $(@D)/bin/* $(@D)/fail2ban
|
||||||
endef
|
endef
|
||||||
FAIL2BAN_DEPENDENCIES += host-python3
|
FAIL2BAN_DEPENDENCIES = host-python3
|
||||||
# We can't use _POST_PATCH_HOOKS because dependencies are not guaranteed
|
# We can't use _POST_PATCH_HOOKS because dependencies are not guaranteed
|
||||||
# to build and install before _POST_PATCH_HOOKS run.
|
# to build and install before _POST_PATCH_HOOKS run.
|
||||||
FAIL2BAN_PRE_CONFIGURE_HOOKS += FAIL2BAN_PYTHON_2TO3
|
FAIL2BAN_PRE_CONFIGURE_HOOKS += FAIL2BAN_PYTHON_2TO3
|
||||||
endif
|
|
||||||
|
|
||||||
define FAIL2BAN_FIX_DEFAULT_CONFIG
|
define FAIL2BAN_FIX_DEFAULT_CONFIG
|
||||||
$(SED) '/^socket/c\socket = /run/fail2ban.sock' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf
|
$(SED) '/^socket/c\socket = /run/fail2ban.sock' $(TARGET_DIR)/etc/fail2ban/fail2ban.conf
|
||||||
@@ -34,8 +32,7 @@ FAIL2BAN_POST_INSTALL_TARGET_HOOKS += FAIL2BAN_FIX_DEFAULT_CONFIG
|
|||||||
|
|
||||||
# fail2ban-python points to host python
|
# fail2ban-python points to host python
|
||||||
define FAIL2BAN_FIX_FAIL2BAN_PYTHON_SYMLINK
|
define FAIL2BAN_FIX_FAIL2BAN_PYTHON_SYMLINK
|
||||||
ln -snf $(if $(BR2_PACKAGE_PYTHON),python,python3) \
|
ln -snf python3 $(TARGET_DIR)/usr/bin/fail2ban-python
|
||||||
$(TARGET_DIR)/usr/bin/fail2ban-python
|
|
||||||
endef
|
endef
|
||||||
FAIL2BAN_POST_INSTALL_TARGET_HOOKS += FAIL2BAN_FIX_FAIL2BAN_PYTHON_SYMLINK
|
FAIL2BAN_POST_INSTALL_TARGET_HOOKS += FAIL2BAN_FIX_FAIL2BAN_PYTHON_SYMLINK
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user