mirror of
https://git.yoctoproject.org/meta-security
synced 2026-05-08 17:19:34 +00:00
fail2ban: replace fail2ban-python shebang with python3
In Yocto, there is only one Python interpreter (python3), and the auto-generated "fail2ban-python" symlink is not used. To ensure all installed scripts can run correctly, replace the shebang line from "#!/usr/bin/env fail2ban-python" to "#!/usr/bin/env python3" during installation. Signed-off-by: Haixiao Yan <haixiao.yan.cn@windriver.com>
This commit is contained in:
committed by
Scott Murray
parent
b639be32ad
commit
dec36ead2e
@@ -40,6 +40,7 @@ do_install:append () {
|
|||||||
|
|
||||||
chown -R root:root ${D}/${bindir}
|
chown -R root:root ${D}/${bindir}
|
||||||
rm -rf ${D}/run
|
rm -rf ${D}/run
|
||||||
|
find ${D}${sysconfdir} -type f -exec sed -i '1s/env fail2ban-python/env python3/' {} +
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install_ptest:append () {
|
do_install_ptest:append () {
|
||||||
@@ -57,6 +58,8 @@ do_install_ptest:append () {
|
|||||||
install -m 0644 ${S}/README.md ${D}${PTEST_PATH}
|
install -m 0644 ${S}/README.md ${D}${PTEST_PATH}
|
||||||
sed -i -e 's|^logpath = README.md|logpath = ${PTEST_PATH}/README.md|g' \
|
sed -i -e 's|^logpath = README.md|logpath = ${PTEST_PATH}/README.md|g' \
|
||||||
${D}${PYTHON_SITEPACKAGES_DIR}/fail2ban/tests/config/jail.conf
|
${D}${PYTHON_SITEPACKAGES_DIR}/fail2ban/tests/config/jail.conf
|
||||||
|
find ${D}${PYTHON_SITEPACKAGES_DIR} -type f -exec sed -i \
|
||||||
|
'1s/env fail2ban-python/env python3/' {} +
|
||||||
}
|
}
|
||||||
|
|
||||||
INITSCRIPT_PACKAGES = "${PN}"
|
INITSCRIPT_PACKAGES = "${PN}"
|
||||||
|
|||||||
Reference in New Issue
Block a user