Message ID | 20240905174910.2442649-1-niklas.soderlund@ragnatech.se |
---|---|
State | New |
Headers | show
Return-Path: <openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=XyrZssSo; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ragnatech.se header.i=@ragnatech.se header.a=rsa-sha256 header.s=fm3 header.b=B3ZiDYjs; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=RR7c1Qzf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (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 legolas.ozlabs.org (Postfix) with ESMTPS id 4X06Ny0cXDz1yg3 for <incoming@patchwork.ozlabs.org>; Fri, 6 Sep 2024 03:51:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=YpiAsS53ycetwPKFEUHrHUmGutB/aurLlvcLy4MmCBY=; b=XyrZssSoD9b6Au aeZUq8PvYj8pJdYSOMePpB+5fLr0erZR2pwELqompE/m5SWMAnU9HgtKAwb9S8Ev7F69Et+019/rG 9/4oGTvlDUtgVIPhgLV4Nz0efyDIvza1g/OxR3babttL6JRenTn5CwCUgHp3vonMLGh1rlvCl2vA/ GPwgc2ugvERrtZQ5eNxinCle0kRJacbmbOJisN6hiX0Bxxmht0xe6HGKA81wk8/yODQTcqYSYAB6Q ymqdHH36G4eq1CX/WJIo8wfP0jcJzW6kDibR4TAhyU1jdTW3vwttJwhE4P0d0R07lLNozQo7YBppj 9Fc3Pwk6xaVIspk4O2tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smGcA-00000009L64-0ZJf; Thu, 05 Sep 2024 17:49:50 +0000 Received: from fout6-smtp.messagingengine.com ([103.168.172.149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smGc5-00000009L3x-0JKb for openwrt-devel@lists.openwrt.org; Thu, 05 Sep 2024 17:49:47 +0000 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id E61B81380239; Thu, 5 Sep 2024 13:49:40 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Thu, 05 Sep 2024 13:49:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm3; t=1725558580; x=1725644980; bh=NU NPestZ8ECCwsiqT7dVbv09ttu15iUnITVLmAVuEbI=; b=B3ZiDYjs4OVNXM8xns KNq99BoWAXpuhyDDG6BbZ8CKe4CVs2b7IMTyThEya4jXAWN8UUyMyZkp84AuRatQ be8V4uwslnajUgyDNnI5an/dkTmMWEApFdVBzTVq4YvYmUMSqYMZqusXTS2C3ACH 9G5BK7RBlpKapRAVzypevBfgW2t1JFIq23NneSePG23hXnidNp5r0eS5+dXkNKiZ aU5A8hnL85TLwyCzZyUlXgVrqpr/9xpyd2WHzozROJsL0mdTE1SbJcdW1GwTk+wr gCBSHXYkyCzzBQsTNQRSxQgk33LtQaPy9t33dqdhintYNExryc2/EzNQkxM/Aa0j DmSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1725558580; x=1725644980; bh=NUNPestZ8ECCw siqT7dVbv09ttu15iUnITVLmAVuEbI=; b=RR7c1QzfdeMyOnjWvfZ/MSj7zNusb Mvr7QJ+HFSgBHN0Okcm9mJY5xu5OWBNu3xhG/rwI65ArpOkQfrQUZY22pUmd+YxW vrIoObceeHOAKdLEg3xnpsG4YBeVU4mICOdiBQAb0oJ3Y0LDwtr/hlXUtq5laf25 2eViayo/ubSpzdROmJ7Ov+PCV/lS60aZoZou7Rv9YcNIsQG/ZzFICqloXoeKUpYz PSOaHcyHGsQzhamB82Dz3syGV9D24L73GSV1QCaAZ99e8s84dLUbWHJHrfwjzzEd TIz16iH6KiU3MbPCDtXVcHzFeOaXU8v6ZqYjbLtZLEpL49Jni8lPgn8Yg== X-ME-Sender: <xms:NO_ZZs6I0tRgCogXtwXempMFmKnbeoBVmZBcZnz81AQtkZs_3KyU_A> <xme:NO_ZZt5va84Qv6jKJdAZCDnTHWI8FWefB93NtC8BGsujNS_bYuBuRyGtShkNkKsVH tt6HpjAUERG-CoMASc> X-ME-Received: <xmr:NO_ZZrdtSAaI5m2T6pO4dCs1QOPYbleCepoB_H1nkMhsKu66X1WZBijQXgXiKCa6xLkY6x3DEMeJnb3iy6Hv-f3JQA> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudehledguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvve fufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpefpihhklhgrshcuufpnuggvrhhl uhhnugcuoehnihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrghtvggthhdrshgvqe enucggtffrrghtthgvrhhnpedttdfhgeffveevgeekteegleegtdeltefhgfeuveffffei gefggfejfeehjeevkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehnihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrghtvggthhdrshgv pdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehoph gvnhifrhhtqdguvghvvghlsehlihhsthhsrdhophgvnhifrhhtrdhorhhgpdhrtghpthht ohepnhhikhhlrghsrdhsohguvghrlhhunhgusehrrghgnhgrthgvtghhrdhsvg X-ME-Proxy: <xmx:NO_ZZhKNANt6DRYvAzxLWFO5K8KhQ9MpF9nlPmfUSpsQxgc2tEAfmw> <xmx:NO_ZZgIB1qLnwNC8imuhjHLQlLcb84tgIkvERJZV72CBb8WgjttpwA> <xmx:NO_ZZizWxMRf6LDwgkDkwm8PRzeNF2SwUhYewiXGfWHXXP0-iLY69Q> <xmx:NO_ZZkJKaKuqpG8qvLd-tYGi_4Ld_VrTD8PYj6LiZd1K_p1w4pxxTA> <xmx:NO_ZZnVsSwiQCEBatDiat6TwFxbnlFgPtlVsr4LLF7ETCGONhvD9Gbbb> Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 5 Sep 2024 13:49:40 -0400 (EDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se> To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se> Subject: [PATCH] dnsmasq: Add support for hostdir argument Date: Thu, 5 Sep 2024 19:49:10 +0200 Message-ID: <20240905174910.2442649-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_104945_626201_C3E8294D X-CRM114-Status: UNSURE ( 9.70 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.8 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add new UCI list 'hostsdir' allowing the usage of the dnsmasq --hostdir argument while also making sure the path is added to the RO jail for the dnsmasq process. This is useful e.g. in case of manuall [...] Content analysis details: (-2.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [103.168.172.149 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [103.168.172.149 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [103.168.172.149 listed in sa-accredit.habeas.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [103.168.172.149 listed in bl.score.senderscore.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org |
Series |
dnsmasq: Add support for hostdir argument
|
expand
|
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index fb061dceed6c..d80578384a57 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -213,6 +213,12 @@ append_addnhosts() { xappend "--addn-hosts=$1" } +append_hostsdir() { + mkdir -p "$1" + append_extramount "$1" + xappend "--hostsdir=$1" +} + append_bogusnxdomain() { xappend "--bogus-nxdomain=$1" } @@ -1011,6 +1017,7 @@ dnsmasq_start() append_addnhosts "$HOSTFILE_DIR" fi config_list_foreach "$cfg" "addnhosts" append_addnhosts + config_list_foreach "$cfg" "hostsdir" append_hostsdir config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain append_parm "$cfg" "leasefile" "--dhcp-leasefile" "/tmp/dhcp.leases"
Add new UCI list 'hostsdir' allowing the usage of the dnsmasq --hostdir argument while also making sure the path is added to the RO jail for the dnsmasq process. This is useful e.g. in case of manually maintaining a set of host-like files that should be monitored for changes that should be applied immediately. This differers from the --addn-hosts host-like files which only takes effect after sending a SIGHUP to the dnsmasq process. It is important to make sure the directory exists before starting the dnsmasq process, as any non-existing directory is ignored and won't be monitored, and a common use-case is to maintain a host-like structure under /tmp. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> --- package/network/services/dnsmasq/files/dnsmasq.init | 7 +++++++ 1 file changed, 7 insertions(+)