From patchwork Tue Sep 26 14:07:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 7259 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Rw1lK4YVfz3wl4 for ; Tue, 26 Sep 2023 14:07:09 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Rw1lG2gYMz2SG; Tue, 26 Sep 2023 14:07:06 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Rw1lG1q2yz2yT2; Tue, 26 Sep 2023 14:07:06 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Rw1lD6PF4z2xPZ for ; Tue, 26 Sep 2023 14:07:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Rw1lC6p15z158; Tue, 26 Sep 2023 14:07:03 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1695737224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Dukh8u78MKhtp3anzgf3cGghckZL7Yo4StJK/z/Nmao=; b=rJ4yYRjJnWiijSTmnuG/Wuslaxqcig6c/6F8TLvwIao+l3GmR5MiXj/IzAyLcI215AQ2Gx /U/lgTFXg3AAbrDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1695737224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Dukh8u78MKhtp3anzgf3cGghckZL7Yo4StJK/z/Nmao=; b=fA0OcZ8le6dwgeBkNy0WTH2VhtOLDDl17mtGdVZAimLTdQYaj8sc71fJmRNZupayHh1zMQ 6TYg2/qpEZVasojoRPolzfQPds9jT9brFVu0lZ7KkTxW1wlUi6W4sGqc5+xr8/CQPOcsPg OjYHKBoAxeopn33rfW3DFmPLYRWjPMQLVrw61ocjM2j0VU+ScZi3NJxOpdLA7qj46DCy1N 7qF/C8M2kD2fx4PszySGuiRPfTtxJNpLtBVZFvfpWH58s9yNX+52tDVQBLfbeqtNUdAYnH 5sp9AglphsttWChf1fuBeeUxs6SOPxcLkfTErM/FhqKYMMVBqblWurozO8z4Zg== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH 1/2] urlfilterctrl: Fix bug#10649 - add option to remove urlfilter from fcron directories Date: Tue, 26 Sep 2023 16:07:00 +0200 Message-ID: <20230926140701.3438340-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - Currently if the urlfilter update is enabled then autoupdate.pl is renamed urlfilter and added into either the daily, weekly or monthly fcron directoiries. If the update is disabled then the urlfilter update script stays in the directory and is not removed. - This patch adds in the option of remove to the urlfilterctrl program. The first part of the urlfilterctrl.c code removes any existing symlinks so all that needs to be done for the remove option is to not add any symlinks to the fcron directories. - Confirmed in a vm testbed that the current approach leaves the symlink in place. Installed the changes from this and the previous patch and confirmed that when the url update is disabled the symlink is removed. Fixes: Bug#10649 Tested-by: Adolf Belka Signed-off-by: Adolf Belka --- src/misc-progs/urlfilterctrl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/misc-progs/urlfilterctrl.c b/src/misc-progs/urlfilterctrl.c index 28dc03075..a11d6d041 100644 --- a/src/misc-progs/urlfilterctrl.c +++ b/src/misc-progs/urlfilterctrl.c @@ -24,6 +24,8 @@ int main(int argc, char *argv[]){ safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.weekly/urlfilter"); } else if (strcmp(argv[2], "monthly") == 0){ safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.monthly/urlfilter"); + } else if (strcmp(argv[2], "remove") == 0){ + // Don't add urlfilter into any fcron directory }else{ printf("invalid parameter(s)\n"); return(1); From patchwork Tue Sep 26 14:07:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 7260 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Rw1lL4mrLz3wtY for ; Tue, 26 Sep 2023 14:07:10 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Rw1lG5RQkz3sS; Tue, 26 Sep 2023 14:07:06 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Rw1lG2Gm0z2yvr; Tue, 26 Sep 2023 14:07:06 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Rw1lD7366z2y4Q for ; Tue, 26 Sep 2023 14:07:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Rw1lD5dYlz2SG; Tue, 26 Sep 2023 14:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1695737224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4HMRYcia0TFTokIB/IVhNBC8THRKtA2SHPJzGPs6wMQ=; b=fOY6P6oZGZBonOX9mTbpQl5EZgzI3smilIGbWkMxIAYlRQZmOVs7fyRlyuwew1epbiDQ6r FXUcYmmOisdweAKDl1lZNjoj3OjOUzt96Avv4GgwM919fC/J+8q/X3StzvVKq7PlOum/t/ ktKEhkCwuvGXWV0Iz9gMeeKGsrgVS/feThtWbNWBTUtJApm9CPPncOQfUCMvfIRWIWoQDb JqOUacqMsNzyyts/tejYmID4S6XCqYdG/BetyiNxsxBdQOdBcjocvJHhwP7YLou0sPrqHN CsFY2JNil40texAdfj5bGvbvIOc9H0TyrBko7GTtEgDZeFUJGAGgRJV3siNvRw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1695737224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4HMRYcia0TFTokIB/IVhNBC8THRKtA2SHPJzGPs6wMQ=; b=oZlRKwuECMYWwuT33QIGPjOXe0hdI6JXQOdkMWPfJQvkGI+f/IYSLi4HTrkMNFvH2k9Ibn f8INBzCfVy0LdzBQ== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH 2/2] urlfilter.cgi: Fixes bug#10649 - calls urlfilterctrl with remove option if update disabled Date: Tue, 26 Sep 2023 16:07:01 +0200 Message-ID: <20230926140701.3438340-2-adolf.belka@ipfire.org> In-Reply-To: <20230926140701.3438340-1-adolf.belka@ipfire.org> References: <20230926140701.3438340-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - When the url filter update enable checkbox is unchecked then this patch calls urlfilterctrl with the remove option added in the otrher patch of this series. - Tested on my vm testbed that this change does remove the urlfilter symlink from the fcron directories when the update is disabled. Fixes: Bug#10649 Tested-by: Adolf Belka Signed-off-by: Adolf Belka --- html/cgi-bin/urlfilter.cgi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/html/cgi-bin/urlfilter.cgi b/html/cgi-bin/urlfilter.cgi index 1e54372f1..1ced06e26 100644 --- a/html/cgi-bin/urlfilter.cgi +++ b/html/cgi-bin/urlfilter.cgi @@ -982,6 +982,11 @@ if ($filtersettings{'ACTION'} eq $Lang::tr{'urlfilter save schedule'}) { &General::system('/usr/local/bin/urlfilterctrl', 'cron', 'monthly'); } + + if ($filtersettings{'ENABLE_AUTOUPDATE'} eq 'off') + { + &General::system('/usr/local/bin/urlfilterctrl', 'cron', 'remove'); + } } }