commit: f57b703d2da4f9419b42795e01c748c6e6015bc5 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org> AuthorDate: Sun Sep 3 07:34:35 2023 +0000 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org> CommitDate: Sun Sep 3 07:34:35 2023 +0000 URL: https://gitweb.gentoo.org/proj/apache.git/commit/?id=f57b703d
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 <jaco <AT> uls.co.za> Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org> 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."