ports/dns/powerdns-recursor/files/pdns_recursor.in
Ralf van der Enden 7386c2ffd5 dns/powerdns-recursor: Update 5.1.1 → 5.1.2 (fix CVE-2024-25590)
PowerDNS Recursor Security Advisory 2024-04:
An attacker can publish a zone containing specific Resource Record Sets.
Repeatedly processing and caching results for these sets can lead to a
denial of service.
CVSS Score: 7.5
https://blog.powerdns.com/2024/10/03/powerdns-recursor-4-9-9-5-0-9-5-1-2-released

PR:	281914
MFH:	2024Q4
2024-10-09 23:26:44 +03:00

48 lines
1.2 KiB
Bash

#!/bin/sh
# PROVIDE: pdns_recursor
# REQUIRE: NETWORKING
# BEFORE: SERVERS
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable pdns_recursor:
#
# pdns_recursor_enable="YES"
# pdns_recursor_flags="<set as needed>"
#
# See pdns_recursor(8) for flags.
#
. /etc/rc.subr
name=pdns_recursor
rcvar=pdns_recursor_enable
load_rc_config ${name}
pdns_recursor_enable=${pdns_recursor_enable:-"NO"}
: ${pdns_recursor_svcj_options:="net_basic"}
pdns_recursor_conf=${pdns_recursor_conf:-"%%PREFIX%%/etc/pdns/recursor.yml"}
required_files=${pdns_recursor_conf}
# run_rc_command would send ${name}_flags as parameters to $command (daemon)
# This ensures they are actually passed to pdns_recursor instead.
actual_pdns_recursor_flags="${pdns_recursor_flags}"
pdns_recursor_flags=""
extra_commands="showyaml"
showyaml_cmd="${name}_showyaml"
pdns_recursor_showyaml()
{
%%PREFIX%%/bin/rec_control show-yaml ${pdns_recursor_conf%%.*}.conf
}
pidfile="/var/run/${name}.pid"
actual_command="%%PREFIX%%/sbin/${name}"
command="/usr/sbin/daemon"
command_args="-c -f -r -P ${pidfile} ${actual_command} --daemon=no --write-pid=no ${actual_pdns_recursor_flags}"
run_rc_command "$1"