From patchwork Tue Apr 9 04:04:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 2191 Return-Path: Received: from mail01.ipfire.org (mail01.i.ipfire.org [172.28.1.200]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail01.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web07.i.ipfire.org (Postfix) with ESMTPS id B3C9188E621 for ; Mon, 8 Apr 2019 19:04:59 +0100 (BST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 44dJGz1Yl6z5DtqT; Mon, 8 Apr 2019 19:04:59 +0100 (BST) Received: from [127.0.0.1] (unknown [IPv6:2a00:1298:8011:212::165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 44dJGv0MF5z5DtqT for ; Mon, 8 Apr 2019 19:04:54 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904rsa; t=1554746695; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=9whC3TYEJjcEQ0di9D5fFMQHIMjYh8GmZm6v4/wlJLs=; b=tVtohDoy7OB0QU7wLeYaZPTeGOpSSrJOh511pBEUdR+pMXqSKonu+Dn+dtdVmSa4s9BIbk Yqpu62lenx/ucWEaef4a9ckSDSsGr5lotUC/B+vc46TgWmw76EBJjdu5uvmFJrkgkS48aK b+GlLPNdAzZwyREofJ/ywYvDo24xH09uE29NIQI8CjP3Qy8TG2aF+itGYN7hIl0syvcrys c/onXwsm+KI3mSBY1ha2S++Lcz7hlL6x2gvkAsIFmZgoSFrVcIrf5hZMGrxDeTJwy01Rr+ ZGr5dxKZQPgk9EpQ1MXmu3U1n1pfdiKzocH+1t8Ow7zT1Oj/tvAMVFNfXog9pg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=201904ed25519; t=1554746695; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=9whC3TYEJjcEQ0di9D5fFMQHIMjYh8GmZm6v4/wlJLs=; b=48bhYzyCtQCvrx7UKV3scIbqVz42pXA2FwIaw/is7g+XA5ZpImpm5YRFklei7DGwNEuRy5 B1MSsTZ2Of+TjXCA== To: "IPFire: Development-List" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH 2/3] Unbound: do not generate PTR if the user requested not to, do so Organization: IPFire.org Message-ID: <9d755e0c-eb20-9ad9-9cb5-9ee38f5cc1ec@ipfire.org> Date: Mon, 08 Apr 2019 18:04:00 +0000 MIME-Version: 1.0 Content-Language: en-US Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=pmueller smtp.mailfrom=peter.mueller@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 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" Partially fixes #12030 Signed-off-by: Peter Müller --- src/initscripts/system/unbound | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/initscripts/system/unbound b/src/initscripts/system/unbound index af9bcef73..107f80477 100644 --- a/src/initscripts/system/unbound +++ b/src/initscripts/system/unbound @@ -172,9 +172,9 @@ own_hostname() { } update_hosts() { - local enabled address hostname domainname + local enabled address hostname domainname generateptr - while IFS="," read -r enabled address hostname domainname; do + while IFS="," read -r enabled address hostname domainname generateptr; do [ "${enabled}" = "on" ] || continue # Build FQDN @@ -185,6 +185,9 @@ update_hosts() { # Skip reverse resolution if the address equals the GREEN address [ "${address}" = "${GREEN_ADDRESS}" ] && continue + # Skip reverse resolution if user requested not to do so + [ "${generateptr}" = "off" ] && continue + # Add RDNS address=$(ip_address_revptr ${address}) unbound-control -q local_data "${address} ${LOCAL_TTL} IN PTR ${fqdn}"