From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 91DD5158170 for ; Sun, 21 Jul 2024 15:12:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5A4AC2BC063; Sun, 21 Jul 2024 15:12:12 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 397272BC063 for ; Sun, 21 Jul 2024 15:12:12 +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 3194A34308B for ; Sun, 21 Jul 2024 15:12:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 969331E48 for ; Sun, 21 Jul 2024 15:12:09 +0000 (UTC) From: "Conrad Kostecki" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Conrad Kostecki" Message-ID: <1721574270.1e4bbd99cb33746c1bf9c0276154bf2a7cd63d20.conikost@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-firewall/ipset/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-firewall/ipset/files/ipset.initd-r6 X-VCS-Directories: net-firewall/ipset/files/ X-VCS-Committer: conikost X-VCS-Committer-Name: Conrad Kostecki X-VCS-Revision: 1e4bbd99cb33746c1bf9c0276154bf2a7cd63d20 X-VCS-Branch: master Date: Sun, 21 Jul 2024 15:12:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: dce26ca2-40a4-446a-8f44-077d8b4cbfb0 X-Archives-Hash: 4023e72c818b2418aae708e27dc9f09e commit: 1e4bbd99cb33746c1bf9c0276154bf2a7cd63d20 Author: Michael Mair-Keimberger levelnine at> AuthorDate: Mon Jul 15 16:56:47 2024 +0000 Commit: Conrad Kostecki gentoo org> CommitDate: Sun Jul 21 15:04:30 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e4bbd99 net-firewall/ipset: remove unused file Signed-off-by: Michael Mair-Keimberger levelnine.at> Signed-off-by: Conrad Kostecki gentoo.org> net-firewall/ipset/files/ipset.initd-r6 | 105 -------------------------------- 1 file changed, 105 deletions(-) diff --git a/net-firewall/ipset/files/ipset.initd-r6 b/net-firewall/ipset/files/ipset.initd-r6 deleted file mode 100644 index 949bdad76044..000000000000 --- a/net-firewall/ipset/files/ipset.initd-r6 +++ /dev/null @@ -1,105 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -extra_commands="save" -extra_started_commands="reload" - -IPSET_SAVE=${IPSET_SAVE:-/var/lib/ipset/rules-save} - -depend() { - before iptables ip6tables -} - -checkconfig() { - if [ ! -f "${IPSET_SAVE}" ] ; then - eerror "Not starting ${SVCNAME}. First create some rules then run:" - eerror "/etc/init.d/${SVCNAME} save" - return 1 - fi - return 0 -} - -start() { - checkconfig || return 1 - ebegin "Loading ipset session" - ipset restore < "${IPSET_SAVE}" - eend $? -} - -stop() { - # check if there are any references to current sets - - if ! ipset list | gawk ' - ($1 == "References:") { refcnt += $2 } - ($1 == "Type:" && $2 == "list:set") { set = 1 } - (scan) { if ($0 != "") setcnt++; else { scan = 0; set = 0 } } - (set && $1 == "Members:") {scan = 1} - END { if ((refcnt - setcnt) > 0) exit 1 } - '; then - eerror "ipset is in use, can't stop" - return 1 - fi - - if [ "${SAVE_ON_STOP}" = "yes" ] ; then - save || return 1 - fi - - ebegin "Removing kernel IP sets" - ipset flush - ipset destroy - eend $? -} - -reload() { - ebegin "Reloading ipsets" - - # Loading sets from a save file is only additive (there is no - # automatic flushing or replacing). And, we can not remove sets - # that are currently used in existing iptables rules. - # - # Instead, we create new temp sets for any set that is already - # in use, and then atomically swap them into place. - # - # XXX: This does not clean out previously used ipsets that are - # not in the new saved policy--it can't, because they may still - # be referenced in the current iptables rules. - - - # Build a list of all currently used sets (if any). - running_ipset_list=$(ipset save | gawk '/^create/{printf "%s ",$2}') - running_ipset_list="${running_ipset_list% }" - - # Check the configured suffix, and make sure there are no collisions - if test -z "${TEMP_SUFFIX}" ; then - eend 1 "TEMP_SUFFIX cannot be empty" - return 1 - elif echo "$running_ipset_list" | grep -q -E "${TEMP_SUFFIX}( |$)" ; then - eend 1 "Existing set(s) match TEMP_SUFFIX pattern ('${TEMP_SUFFIX}'), cannot continue" - return 1 - fi - - # Build a regular expression that matches those set names. - running_ipset_list_regex="$(echo "$running_ipset_list" | tr -s ' ' '|' )" - - # Load up sets from the save file, but rename any set that already - # exists to a temporary name that we will swap later. - if ! cat ${IPSET_SAVE} | sed -r "s/^(create|add) (${running_ipset_list_regex}) /\1 \2${TEMP_SUFFIX} /" | ipset restore ; then - eend $? "Failed to load new ipsets" - fi - - # Now for every set name that currently exists, atomically swap it - # with the temporary new one we created, and then destroy the old set. - for ipset_name in ${running_ipset_list} ; do - ipset swap ${ipset_name} ${ipset_name}${TEMP_SUFFIX} || eend $? "Failed to swap in new ipset $ipset_name" - ipset destroy ${ipset_name}${TEMP_SUFFIX} || eend $? "Failed to delete obsolete ipset ${ipset_name}${TEMP_SUFFIX}" - done - eend 0 -} - -save() { - ebegin "Saving ipset session" - checkpath --file --mode 0600 "${IPSET_SAVE}" - ipset -output save list > "${IPSET_SAVE}" - eend $? -}