From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1551763-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 248EC158089
	for <garchives@archives.gentoo.org>; Sun,  3 Sep 2023 07:40:34 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 63B382BC014;
	Sun,  3 Sep 2023 07:40:33 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 42C792BC014
	for <gentoo-commits@lists.gentoo.org>; Sun,  3 Sep 2023 07:40:33 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 7A2C1335CD2
	for <gentoo-commits@lists.gentoo.org>; Sun,  3 Sep 2023 07:40:32 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id CD3D6DAC
	for <gentoo-commits@lists.gentoo.org>; Sun,  3 Sep 2023 07:40:30 +0000 (UTC)
From: "Hans de Graaff" <graaff@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Hans de Graaff" <graaff@gentoo.org>
Message-ID: <1693726475.f57b703d2da4f9419b42795e01c748c6e6015bc5.graaff@gentoo>
Subject: [gentoo-commits] proj/apache:master commit in: 2.4/init/
X-VCS-Repository: proj/apache
X-VCS-Files: 2.4/init/apache2.initd
X-VCS-Directories: 2.4/init/
X-VCS-Committer: graaff
X-VCS-Committer-Name: Hans de Graaff
X-VCS-Revision: f57b703d2da4f9419b42795e01c748c6e6015bc5
X-VCS-Branch: master
Date: Sun,  3 Sep 2023 07:40:30 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 020f43d3-c6cc-49af-95c6-72c99a018880
X-Archives-Hash: e355d0ce0c98bfb5b1136b72accfce04

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."