From f57b703d2da4f9419b42795e01c748c6e6015bc5 Mon Sep 17 00:00:00 2001 From: Hans de Graaff Date: Sun, 3 Sep 2023 09:34:35 +0200 Subject: Fix interface binding check in init.d file Fix two issues with the interface binding check: 1) don't special case ports 80 and 443 since the interface requirement also applies to all other ports. 2) on show the warning for non-generic binds (i.e. binding a specific IP address) since that requires the associated interface to be up first. Bug: https://bugs.gentoo.org/913227 Bug: https://github.com/gentoo/gentoo/pull/32529 Signed-off-by: Jaco Kroon Signed-off-by: Hans de Graaff --- 2.4/init/apache2.initd | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/2.4/init/apache2.initd b/2.4/init/apache2.initd index 0058e20..1691007 100755 --- a/2.4/init/apache2.initd +++ b/2.4/init/apache2.initd @@ -36,13 +36,8 @@ depend() { use dns entropy logger mysql netmount postgresql after sshd if ! echo ${rc_need} | grep -Fq "net." ; then - local x warn_addr - for x in $(virtualhosts 2>/dev/null | grep '^\(\[\|\*:\|\)[[:digit:]]' | sed 's@\(:[[:digit:]]\{1,5\}\)\([[:space:]].*\|$\)@\1@' | sort -u) ; do - case "${x}" in - \*:80|\*:443) ;; - *) warn_addr="${warn_addr} ${x}" ;; - esac - done + local warn_addr + warn_addr="$(virtualhosts 2>/dev/null | sed -nre 's/^([^ *]+:[0-9]+)[[:space:]].*/\1/p' | tr '\n' ' ')" if [ -n "${warn_addr}" ] ; then need net ewarn "You are binding an interface in you virtual hosts." -- cgit v1.2.3-65-gdbad