diff options
author | 2023-09-03 09:34:35 +0200 | |
---|---|---|
committer | 2023-09-03 09:34:35 +0200 | |
commit | f57b703d2da4f9419b42795e01c748c6e6015bc5 (patch) | |
tree | b405b8afe654258ced6d1e7263c0062e7042802c | |
parent | Update default ssl vhost config to modern standards (diff) | |
download | apache-f57b703d2da4f9419b42795e01c748c6e6015bc5.tar.gz apache-f57b703d2da4f9419b42795e01c748c6e6015bc5.tar.bz2 apache-f57b703d2da4f9419b42795e01c748c6e6015bc5.zip |
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@uls.co.za>
Signed-off-by: Hans de Graaff <graaff@gentoo.org>
-rwxr-xr-x | 2.4/init/apache2.initd | 9 |
1 files 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." |