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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 85F401382C5 for ; Sat, 5 Jun 2021 21:23:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DFA76E096F; Sat, 5 Jun 2021 21:23:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C4745E096F for ; Sat, 5 Jun 2021 21:23:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D427D340E9D for ; Sat, 5 Jun 2021 21:23:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D42297A4 for ; Sat, 5 Jun 2021 21:23:14 +0000 (UTC) From: "Sven Wegener" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Wegener" Message-ID: <1622928061.e93b43433306a40fa13304ab365472df313bca67.swegener@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/pdns-recursor/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-dns/pdns-recursor/files/pdns-recursor-r2 X-VCS-Directories: net-dns/pdns-recursor/files/ X-VCS-Committer: swegener X-VCS-Committer-Name: Sven Wegener X-VCS-Revision: e93b43433306a40fa13304ab365472df313bca67 X-VCS-Branch: master Date: Sat, 5 Jun 2021 21:23:14 +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: ff237ea0-4720-4173-a096-454ccf2c4875 X-Archives-Hash: df53d5fb295fcb868235d215b3e29836 commit: e93b43433306a40fa13304ab365472df313bca67 Author: Sven Wegener gentoo org> AuthorDate: Sat Jun 5 20:57:47 2021 +0000 Commit: Sven Wegener gentoo org> CommitDate: Sat Jun 5 21:21:01 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e93b4343 net-dns/pdns-recursor: Create socket-dir with correct user Package-Manager: Portage-3.0.18, Repoman-3.0.2 Closes: https://bugs.gentoo.org/793854 Signed-off-by: Sven Wegener gentoo.org> net-dns/pdns-recursor/files/pdns-recursor-r2 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/net-dns/pdns-recursor/files/pdns-recursor-r2 b/net-dns/pdns-recursor/files/pdns-recursor-r2 index 01ce79167bb..0ca3dfc1878 100644 --- a/net-dns/pdns-recursor/files/pdns-recursor-r2 +++ b/net-dns/pdns-recursor/files/pdns-recursor-r2 @@ -1,12 +1,18 @@ #!/sbin/openrc-run -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +get_config_option() { + awk -v option="${1}" -F = '$1 == option { print $2 }' "${PDNS_CONFIG}" +} + PDNS_CONFIGDIR="${PDNS_CONFIGDIR:-/etc/powerdns}" PDNS_CONFIG="${PDNS_CONFIGDIR}/recursor.conf" -PDNS_CHROOTDIR="$( awk -F = '$1 == "chroot" { print $2 }' "${PDNS_CONFIG}" )" -PDNS_SOCKETDIR="$( awk -F = '$1 == "socket-dir" { print $2 }' "${PDNS_CONFIG}" )" +PDNS_CHROOTDIR="$( get_config_option chroot )" +PDNS_SOCKETDIR="$( get_config_option socket-dir )" +PDNS_SETUID="$( get_config_option setuid )" +PDNS_SETGID="$( get_config_option setgid )" [ -z "${PDNS_SOCKETDIR}" -a -z "${PDNS_CHROOTDIR}" ] && PDNS_SOCKETDIR="/var/run/pdns-recursor" name="PowerDNS Recursor" @@ -31,7 +37,7 @@ depend() { } start_pre() { - checkpath --directory --mode 750 "${PDNS_CHROOTDIR}/${PDNS_SOCKETDIR}" + checkpath --directory --owner "${PDNS_SETUID:-root}:${PDNS_SETGID:-root}" --mode 750 "${PDNS_CHROOTDIR}/${PDNS_SOCKETDIR}" } ping() {