Author: pfg Date: Wed Nov 20 22:20:11 2019 New Revision: 354918 URL: https://svnweb.freebsd.org/changeset/base/354918
Log: Undo r354917 to correct the log: it was actually version 3.9.2 Added: vendor/openresolv/dist/README - copied unchanged from r354916, vendor/openresolv/dist/README Deleted: vendor/openresolv/dist/LICENSE vendor/openresolv/dist/README.md Modified: vendor/openresolv/dist/Makefile vendor/openresolv/dist/configure vendor/openresolv/dist/dnsmasq.in vendor/openresolv/dist/libc.in vendor/openresolv/dist/named.in vendor/openresolv/dist/pdns_recursor.in vendor/openresolv/dist/pdnsd.in vendor/openresolv/dist/resolvconf.conf vendor/openresolv/dist/resolvconf.conf.5.in vendor/openresolv/dist/resolvconf.in vendor/openresolv/dist/unbound.in Modified: vendor/openresolv/dist/Makefile ============================================================================== --- vendor/openresolv/dist/Makefile Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/Makefile Wed Nov 20 22:20:11 2019 (r354918) @@ -10,7 +10,6 @@ SYSCONFDIR?= /etc LIBEXECDIR?= /libexec/resolvconf VARDIR?= /var/run/resolvconf -ECHO?= echo INSTALL?= install SED?= sed @@ -21,7 +20,7 @@ DOCMODE?= 0644 MANMODE?= 0444 RESOLVCONF= resolvconf resolvconf.8 resolvconf.conf.5 -SUBSCRIBERS= libc dnsmasq named pdnsd pdns_recursor unbound +SUBSCRIBERS= libc dnsmasq named pdnsd unbound TARGET= ${RESOLVCONF} ${SUBSCRIBERS} SRCS= ${TARGET:C,$,.in,} # pmake SRCS:= ${TARGET:=.in} # gmake @@ -43,7 +42,7 @@ DISTINFOSIGN= ${DISTINFO}.asc CKSUM?= cksum -a SHA256 PGP?= netpgp -GITREF?= HEAD +FOSSILID?= current .SUFFIXES: .in @@ -80,17 +79,15 @@ maninstall: install: proginstall maninstall -dist-git: - git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE} - -dist-inst: - mkdir /tmp/${DISTPREFIX} - cp -RPp * /tmp/${DISTPREFIX} - (cd /tmp/${DISTPREFIX}; make clean) - tar -cvjpf ${DISTFILE} -C /tmp ${DISTPREFIX} +import: rm -rf /tmp/${DISTPREFIX} + ${INSTALL} -d /tmp/${DISTPREFIX} + cp README ${SRCS} /tmp/${DISTPREFIX} -dist: dist-git +dist: + fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ} + gunzip -c ${DISTFILEGZ} | xz >${DISTFILE} + rm ${DISTFILEGZ} distinfo: dist rm -f ${DISTINFO} ${DISTINFOSIGN} @@ -99,20 +96,3 @@ distinfo: dist ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO} chmod 644 ${DISTINFOSIGN} ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} - -import: dist - rm -rf /tmp/${DISTPREFIX} - ${INSTALL} -d /tmp/${DISTPREFIX} - tar xvJpf ${DISTFILE} -C /tmp - -_import-src: - rm -rf ${DESTDIR}/* - ${INSTALL} -d ${DESTDIR} - cp LICENSE README.md ${SRCS} resolvconf.conf ${DESTDIR}; - cp resolvconf.8.in resolvconf.conf.5.in ${DESTDIR}; - @${ECHO} - @${ECHO} "=============================================================" - @${ECHO} "openresolv-${VERSION} imported to ${DESTDIR}" - -import-src: - ${MAKE} _import-src DESTDIR=`if [ -n "${DESTDIR}" ]; then echo "${DESTDIR}"; else echo /tmp/${DISTPREFIX}; fi` Copied: vendor/openresolv/dist/README (from r354916, vendor/openresolv/dist/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openresolv/dist/README Wed Nov 20 22:20:11 2019 (r354918, copy of r354916, vendor/openresolv/dist/README) @@ -0,0 +1,11 @@ +openresolv is a resolvconf implementation which manages resolv.conf +You can find the latest version at http://roy.marples.name/projects/openresolv +It is written and maintained by Roy Marples <r...@marples.name> + +This resolvconf implementation, along with its subscribers, work with a +POSIX compliant shell and userland utilities. It is designed to work without +tools such as sed as it *has* to work without /usr being available. + +On systems where resolvconf is expected to be used before /var/run is available +for writing, you can configure openresolv to write somewhere else, like say a +ramdisk. Modified: vendor/openresolv/dist/configure ============================================================================== --- vendor/openresolv/dist/configure Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/configure Wed Nov 20 22:20:11 2019 (r354918) @@ -44,8 +44,42 @@ for x do esac done +if [ -z "$LIBEXECDIR" ]; then + printf "Checking for directory /libexec ... " + if [ -d /libexec ]; then + echo "yes" + LIBEXECDIR=$PREFIX/libexec/resolvconf + else + echo "no" + LIBEXECDIR=$PREFIX/lib/resolvconf + fi +fi +if [ -z "$RUNDIR" ]; then + printf "Checking for directory /run ... " + if [ -d /run ]; then + echo "yes" + RUNDIR=/run + else + echo "no" + RUNDIR=/var/run + fi +fi + : ${SED:=sed} +: ${SYSCONFDIR:=$PREFIX/etc} +: ${SBINDIR:=$PREFIX/sbin} +: ${LIBEXECDIR:=$PREFIX/libexec/resolvconf} +: ${STATEDIR:=/var} +: ${RUNDIR:=$STATEDIR/run} +: ${MANDIR:=${PREFIX:-/usr}/share/man} + +eval SYSCONFDIR="$SYSCONFDIR" +eval SBINDIR="$SBINDIR" +eval LIBEXECDIR="$LIBEXECDIR" +eval VARDIR="$RUNDIR/resolvconf" +eval MANDIR="$MANDIR" + CONFIG_MK=config.mk if [ -z "$BUILD" ]; then @@ -87,19 +121,7 @@ rm -rf $CONFIG_MK echo "# $OS" >$CONFIG_MK case "$OS" in -dragonfly*) - # This means /usr HAS to be mounted not via dhcpcd - : ${LIBEXECDIR:=${PREFIX:-/usr}/libexec/resolvconf} - ;; -linux*) - # cksum does't support -a and netpgp is rare - echo "CKSUM= sha256sum --tag" >>$CONFIG_MK - echo "PGP= gpg2" >>$CONFIG_MK - ;; -esac - -case "$OS" in -dragonfly*|freebsd*) +freebsd*) # On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled # regardless of if it's not running. # So we force onestatus to work around this silly bug. @@ -107,42 +129,12 @@ dragonfly*|freebsd*) STATUSARG="onestatus" fi ;; +linux*) + # cksum does't support -a and netpgp is rare + echo "CKSUM= sha256sum --tag" >>$CONFIG_MK + echo "PGP= gpg2" >>$CONFIG_MK + ;; esac - - -if [ -z "$LIBEXECDIR" ]; then - printf "Checking for directory /libexec ... " - if [ -d /libexec ]; then - echo "yes" - LIBEXECDIR=$PREFIX/libexec/resolvconf - else - echo "no" - LIBEXECDIR=$PREFIX/lib/resolvconf - fi -fi -if [ -z "$RUNDIR" ]; then - printf "Checking for directory /run ... " - if [ -d /run ]; then - echo "yes" - RUNDIR=/run - else - echo "no" - RUNDIR=/var/run - fi -fi - -: ${SYSCONFDIR:=$PREFIX/etc} -: ${SBINDIR:=$PREFIX/sbin} -: ${LIBEXECDIR:=$PREFIX/libexec/resolvconf} -: ${STATEDIR:=/var} -: ${RUNDIR:=$STATEDIR/run} -: ${MANDIR:=${PREFIX:-/usr}/share/man} - -eval SYSCONFDIR="$SYSCONFDIR" -eval SBINDIR="$SBINDIR" -eval LIBEXECDIR="$LIBEXECDIR" -eval VARDIR="$RUNDIR/resolvconf" -eval MANDIR="$MANDIR" for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR RESTARTCMD RCDIR STATUSARG do Modified: vendor/openresolv/dist/dnsmasq.in ============================================================================== --- vendor/openresolv/dist/dnsmasq.in Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/dnsmasq.in Wed Nov 20 22:20:11 2019 (r354918) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2019 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # dnsmasq subscriber for resolvconf @@ -28,7 +28,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 -[ -z "${dnsmasq_conf}${dnsmasq_resolv}" ] && exit 0 +[ -z "$dnsmasq_conf" -a -z "$dnsmasq_resolv" ] && exit 0 [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -98,7 +98,7 @@ for d in $DOMAINS; do empty=false i=0 IFS=: set -- $n - while [ -n "$1" ] || [ -n "$2" ]; do + while [ -n "$1" -o -n "$2" ]; do addr="$1" shift if [ -z "$addr" ]; then @@ -184,7 +184,7 @@ if $changed; then eval $dnsmasq_restart elif [ -n "$RESTARTCMD" ]; then set -- ${dnsmasq_service} - eval "$RESTARTCMD" + eval $RESTARTCMD else @SBINDIR@/resolvconf -r ${dnsmasq_service} fi @@ -206,6 +206,4 @@ if $dbus; then dbus-send --system --dest=uk.org.thekelleys.dnsmasq \ /uk/org/thekelleys/dnsmasq uk.org.thekelleys.$method \ $dbusdest - dbus-send --system --dest=uk.org.thekelleys.dnsmasq \ - /uk/org/thekelleys/dnsmasq uk.org.thekelleys.ClearCache fi Modified: vendor/openresolv/dist/libc.in ============================================================================== --- vendor/openresolv/dist/libc.in Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/libc.in Wed Nov 20 22:20:11 2019 (r354918) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2019 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # libc subscriber for resolvconf @@ -36,9 +36,9 @@ NL=" # sed may not be available, and this is faster on small files key_get_value() { - key="$1" - shift + local key="$1" x= line= + shift if [ $# -eq 0 ]; then while read -r line; do case "$line" in @@ -58,6 +58,8 @@ key_get_value() keys_remove() { + local key x line found + while read -r line; do found=false for key do @@ -77,7 +79,7 @@ local_nameservers="127.* 0.0.0.0 255.255.255.255 ::1" if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then . "$SYSCONFDIR"/resolvconf.conf elif [ -d "$SYSCONFDIR"/resolvconf ]; then - SYSCONFDIR="$SYSCONFDIR/resolvconf" + SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d" base="$SYSCONFDIR/resolv.conf.d/base" if [ -f "$base" ]; then prepend_nameservers="$(key_get_value "nameserver " "$base")" @@ -96,12 +98,10 @@ fi : ${resolv_conf:=/etc/resolv.conf} : ${libc_service:=nscd} : ${list_resolv:=@SBINDIR@/resolvconf -l} -if [ "${resolv_conf_head-x}" = x ] && [ -f "$SYSCONFDIR"/resolv.conf.head ] -then +if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)" fi -if [ "${resolv_conf_tail-x}" = x ] && [ -f "$SYSCONFDIR"/resolv.conf.tail ] -then +if [ "${resolv_conf_tail-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.tail ]; then resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.tail)" fi @@ -110,7 +110,7 @@ signature="# Generated by resolvconf" uniqify() { - result= + local result= while [ -n "$1" ]; do case " $result " in *" $1 "*);; @@ -126,7 +126,7 @@ case "${resolv_conf_passthrough:-NO}" in backup=false newest= for conf in "$IFACEDIR"/*; do - if [ -z "$newest" ] || [ "$conf" -nt "$newest" ]; then + if [ -z "$newest" -o "$conf" -nt "$newest" ]; then newest="$conf" fi done @@ -178,7 +178,7 @@ case "${resolv_conf_passthrough:-NO}" in fi [ -n "$domain" ] && newconf="${newconf}domain $domain$NL" - if [ -n "$newsearch" ] && [ "$newsearch" != "$domain" ]; then + if [ -n "$newsearch" -a "$newsearch" != "$domain" ]; then newconf="${newconf}search $newsearch$NL" fi for n in $newns; do @@ -232,7 +232,7 @@ if [ -n "$libc_restart" ]; then eval $libc_restart elif [ -n "$RESTARTCMD" ]; then set -- ${libc_service} - eval "$RESTARTCMD" + eval $RESTARTCMD else @SBINDIR@/resolvconf -r ${libc_service} fi Modified: vendor/openresolv/dist/named.in ============================================================================== --- vendor/openresolv/dist/named.in Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/named.in Wed Nov 20 22:20:11 2019 (r354918) @@ -28,14 +28,14 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 -[ -z "${named_zones}${named_options}" ] && exit 0 +[ -z "$named_zones" -a -z "$named_options" ] && exit 0 [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " # Platform specific kludges -if [ -z "${named_service}${named_restart}" ] && - [ -d "$RCDIR" ] && ! [ -x "$RCDIR"/named ] +if [ -z "$named_service" -a -z "$named_restart" -a \ + -d "$RCDIR" -a ! -x "$RCDIR"/named ] then if [ -x "$RCDIR"/bind9 ]; then # Debian and derivatives @@ -111,7 +111,7 @@ if $changed; then eval $named_restart elif [ -n "$RESTARTCMD" ]; then set -- ${named_service} - eval "$RESTARTCMD" + eval $RESTARTCMD else @SBINDIR@/resolvconf -r ${named_service} fi Modified: vendor/openresolv/dist/pdns_recursor.in ============================================================================== --- vendor/openresolv/dist/pdns_recursor.in Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/pdns_recursor.in Wed Nov 20 22:20:11 2019 (r354918) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2009-2019 Roy Marples +# Copyright (c) 2009-2011 Roy Marples # All rights reserved # PowerDNS Recursor subscriber for resolvconf @@ -33,14 +33,17 @@ NL=" " -: ${pdns_service:=pdns-recursor} +: ${pdns_service:=pdns_recursor} newzones= -for n in $NAMESERVERS; do - newzones="$newzones${newzones:+,}$n" -done -[ -n "$newzones" ] && newzones="+.=$newzones$NL" +# pds_recursor does not present support global forward servers, which +# does limit it's usefulness somewhat. +# If it did, the below code can be enabled, or something like it. +#for n in $NAMESERVERS; do +# newzones="$newzones${newzones:+,}$n" +#done +#[ -n "$newzones" ] && newzones=".=$newzones$NL" for d in $DOMAINS; do newns= @@ -68,7 +71,7 @@ then eval $pdns_restart elif [ -n "$RESTARTCMD" ]; then set -- ${pdns_service} - eval "$RESTARTCMD" + eval $RESTARTCMD else @SBINDIR@/resolvconf -r ${pdns_service} fi Modified: vendor/openresolv/dist/pdnsd.in ============================================================================== --- vendor/openresolv/dist/pdnsd.in Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/pdnsd.in Wed Nov 20 22:20:11 2019 (r354918) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2010-2018 Roy Marples +# Copyright (c) 2010-2013 Roy Marples # All rights reserved # pdnsd subscriber for resolvconf @@ -28,7 +28,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 -[ -z "${pdnsd_conf}${pdnsd_resolv}" ] && exit 0 +[ -z "$pdnsd_conf" -a -z "$pdnsd_resolv" ] && exit 0 [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -41,16 +41,14 @@ signature_end="# End of resolvconf" # but sed may not always be available at the time. remove_markers() { - m1="$1" - m2="$2" - in_marker=0 + local m1="$1" m2="$2" x= line= in_marker=0 shift; shift if type sed >/dev/null 2>&1; then sed "/^$m1/,/^$m2/d" $@ else - for x do - while read line; do + for x; do + while read -r line; do case "$line" in "$m1"*) in_marker=1;; "$m2"*) in_marker=0;; Modified: vendor/openresolv/dist/resolvconf.conf ============================================================================== --- vendor/openresolv/dist/resolvconf.conf Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/resolvconf.conf Wed Nov 20 22:20:11 2019 (r354918) @@ -4,4 +4,4 @@ resolv_conf=/etc/resolv.conf # If you run a local name server, you should uncomment the below line and # configure your subscribers configuration files below. -#name_servers=127.0.0.1 +#name_servers=127.0.0.1 \ No newline at end of file Modified: vendor/openresolv/dist/resolvconf.conf.5.in ============================================================================== --- vendor/openresolv/dist/resolvconf.conf.5.in Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/resolvconf.conf.5.in Wed Nov 20 22:20:11 2019 (r354918) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 8, 2019 +.Dd December 29, 2016 .Dt RESOLVCONF.CONF 5 .Os .Sh NAME @@ -64,25 +64,19 @@ Defaults to YES. .It Sy interface_order These interfaces will always be processed first. If unset, defaults to the following:- -.Bd -compact -literal -offset indent -lo lo[0-9]* -.Ed +.D1 lo lo[0-9]* .It Sy dynamic_order These interfaces will be processed next, unless they have a metric. If unset, defaults to the following:- -.Bd -compact -literal -offset indent -tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]* -.Ed +.D1 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]* .It Sy inclusive_interfaces -Ignore any exclusive marking for these interfaces. +Ignore any exlcusive marking for these interfaces. This is handy when 3rd party integrations force the .Nm resolvconf -x option and you want to disable it easily. .It Sy local_nameservers If unset, defaults to the following:- -.Bd -compact -literal -offset indent -127.* 0.0.0.0 255.255.255.255 ::1 -.Ed +.D1 127.* 0.0.0.0 255.255.255.255 ::1 .It Sy search_domains Prepend search domains to the dynamically generated list. .It Sy search_domains_append @@ -124,24 +118,16 @@ The syntax is this: .Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement .Pp Example, given this resolv.conf: -.Bd -compact -literal -offset indent -domain foo.org -search foo.org dead.beef -nameserver 1.2.3.4 -nameserver 2.3.4.5 -.Ed +.D1 domain foo.org +.D1 search foo.org dead.beef +.D1 nameserver 1.2.3.4 +.D1 nameserver 2.3.4.5 and this configuaration: -.Bd -compact -literal -offset indent -replace="search/foo*/bar.com" -replace="$replace nameserver/1.2.3.4/5.6.7.8" -replace="$replace nameserver/2.3.4.5/" -.Ed +.D1 replace="search/foo*/bar.com nameserver/1.2.3.4/5.6.7.8 nameserver/2.3.4.5/" you would get this resolv.conf instead: -.Bd -compact -literal -offset indent -domain foo.org -search bar.com -nameserver 5.6.7.8 -.Ed +.D1 domain foo.org +.D1 search bar.com +.D1 nameserver 5.6.7.8 .It Sy replace_sub Works the same way as .Sy replace @@ -152,11 +138,9 @@ Using the same example resolv.conf and changing to .Sy replace_sub , you would get this resolv.conf instead: -.Bd -compact -literal -offset indent -domain foo.org -search bar.com dead.beef -nameserver 5.6.7.8 -.Ed +.D1 domain foo.org +.D1 search bar.com dead.beef +.D1 nameserver 5.6.7.8 .It Sy state_dir Override the default state directory of .Pa @VARDIR@ . @@ -211,8 +195,7 @@ Prepend search domains to the dynamically generated li openresolv ships with subscribers for the name servers .Xr dnsmasq 8 , .Xr named 8 , -.Xr pdnsd 8 , -.Xr pdns_recursor 8 , +.Xr pdnsd 8 and .Xr unbound 8 . Each subscriber can create configuration files which should be included in @@ -220,9 +203,7 @@ in the subscribers main configuration file. .Pp To disable a subscriber, simply set it's name to NO. For example, to disable the libc subscriber you would set: -.Bd -compact -literal -offset indent -libc=NO -.Ed +.D1 libc=NO .Bl -tag -width indent .It Sy dnsmasq_conf This file tells dnsmasq which name servers to use for specific domains. @@ -230,21 +211,17 @@ This file tells dnsmasq which name servers to use for This file tells dnsmasq which name servers to use for global lookups. .Pp Example resolvconf.conf for dnsmasq: -.Bd -compact -literal -offset indent -name_servers=127.0.0.1 -dnsmasq_conf=/etc/dnsmasq-conf.conf -dnsmasq_resolv=/etc/dnsmasq-resolv.conf -.Ed +.D1 name_servers=127.0.0.1 +.D1 dnsmasq_conf=/etc/dnsmasq-conf.conf +.D1 dnsmasq_resolv=/etc/dnsmasq-resolv.conf .Pp Example dnsmasq.conf: -.Bd -compact -literal -offset indent -listen-address=127.0.0.1 -# If dnsmasq is compiled for DBus then we can take -# advantage of not having to restart dnsmasq. -enable-dbus -conf-file=/etc/dnsmasq-conf.conf -resolv-file=/etc/dnsmasq-resolv.conf -.Ed +.D1 listen-address=127.0.0.1 +.D1 # If dnsmasq is compiled for DBus then we can take +.D1 # advantage of not having to restart dnsmasq. +.D1 enable-dbus +.D1 conf-file=/etc/dnsmasq-conf.conf +.D1 resolv-file=/etc/dnsmasq-resolv.conf .It Sy named_options Include this file in the named options block. This file tells named which name servers to use for global lookups. @@ -253,21 +230,16 @@ Include this file in the named global scope, after the This file tells named which name servers to use for specific domains. .Pp Example resolvconf.conf for named: -.Bd -compact -literal -offset indent -name_servers=127.0.0.1 -named_options=/etc/named-options.conf -named_zones=/etc/named-zones.conf -.Ed +.D1 name_servers=127.0.0.1 +.D1 named_options=/etc/named-options.conf +.D1 named_zones=/etc/named-zones.conf .Pp Example named.conf: -.Bd -compact -literal -offset indent -options { - listen-on { 127.0.0.1; }; - include "/etc/named-options.conf"; -}; - -include "/etc/named-zones.conf"; -.Ed +.D1 options { +.D1 listen-on { 127.0.0.1; }; +.D1 include "/etc/named-options.conf"; +.D1 }; +.D1 include "/etc/named-zones.conf"; .It Sy pdnsd_conf This is the main pdnsd configuration file which we modify to add our forward domains to. @@ -281,54 +253,32 @@ If this variable is not set then it's written to .Pa pdnsd_conf . .Pp Example resolvconf.conf for pdnsd: -.Bd -compact -literal -offset indent -name_servers=127.0.0.1 -pdnsd_conf=/etc/pdnsd.conf -# pdnsd_resolv=/etc/pdnsd-resolv.conf -.Ed +.D1 name_servers=127.0.0.1 +.D1 pdnsd_conf=/etc/pdnsd.conf +.D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf .Pp Example pdnsd.conf: -.Bd -compact -literal -offset indent -global { - server_ip = 127.0.0.1; - status_ctl = on; -} -server { - # A server definition is required, even if empty. - label="empty"; - proxy_only=on; - # file="/etc/pdnsd-resolv.conf"; -} -.Ed -.It Sy pdns_zones -This file tells pdns_recursor about specific and global name servers. -.Pp -Example resolvconf.conf for pdns_recursor: -.Bd -compact -literal -offset indent -name_servers=127.0.0.1 -pdns_zones=/etc/pdns/recursor-zones.conf -.Ed -.Pp -Example recursor.conf: -.Bd -compact -literal -offset indent -allow-from=127.0.0.0/8, ::1/128 -forward-zones-file=/etc/pdns/recursor-zones.conf -.Ed +.D1 global { +.D1 server_ip = 127.0.0.1; +.D1 status_ctl = on; +.D1 } +.D1 server { +.D1 # A server definition is required, even if emtpy. +.D1 label="empty"; +.D1 proxy_only=on; +.D1 # file="/etc/pdnsd-resolv.conf"; +.D1 } .It Sy unbound_conf This file tells unbound about specific and global name servers. .It Sy unbound_insecure When set to YES, unbound marks the domains as insecure, thus ignoring DNSSEC. .Pp Example resolvconf.conf for unbound: -.Bd -compact -literal -offset indent -name_servers=127.0.0.1 -unbound_conf=/etc/unbound-resolvconf.conf -.Ed +.D1 name_servers=127.0.0.1 +.D1 unbound_conf=/etc/unbound-resolvconf.conf .Pp Example unbound.conf: -.Bd -compact -literal -offset indent -include: /etc/unbound-resolvconf.conf -.Ed +.D1 include: /etc/unbound-resolvconf.conf .El .Sh SUBSCRIBER INTEGRATION Not all distributions store the files the subscribers need in the same @@ -342,6 +292,7 @@ Also, users could equally want to use a different vers installed by default, such as bind8 and bind9. To accommodate this, the subscribers have these files in configurable variables, documented below. +.Pp .Bl -tag -width indent .It Sy dnsmasq_service Name of the dnsmasq service. @@ -359,10 +310,6 @@ Name of the named service. Command to restart the named service. .It Sy pdnsd_restart Command to restart the pdnsd service. -.It Sy pdns_service -Command to restart the pdns_recursor service. -.It Sy pdns_restart -Command to restart the pdns_recursor service. .It Sy unbound_service Name of the unbound service. .It Sy unbound_restart Modified: vendor/openresolv/dist/resolvconf.in ============================================================================== --- vendor/openresolv/dist/resolvconf.in Wed Nov 20 22:13:14 2019 (r354917) +++ vendor/openresolv/dist/resolvconf.in Wed Nov 20 22:20:11 2019 (r354918) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2019 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. RESOLVCONF="$0" -OPENRESOLV_VERSION="3.9.2" +OPENRESOLV_VERSION="3.9.0" SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ @@ -125,22 +125,21 @@ usage() # If you think otherwise, capture a DNS trace and you'll see libc # will strip it regardless. # This also solves setting up duplicate zones in our subscribers. -# Also strip any comments denoted by #. -resolv_strip() +strip_trailing_dots() { - space= - for word; do - case "$word" in - \#*) break;; - esac - printf "%s%s" "$space${word%.}" - space=" " + local n= d= + + for n; do + printf "$d%s" "${n%.}" + d=" " done printf "\n" } private_iface() { + local p + # Allow expansion cd "$IFACEDIR" @@ -169,15 +168,12 @@ private_iface() # for domain name servers, search name servers and global nameservers parse_resolv() { - domain= - new=true + local line= ns= ds= search= d= n= newns= + local new=true iface= private=false p= domain= l= islocal= + newns= - ns= - private=false - search= while read -r line; do - stripped_line="$(resolv_strip ${line#* })" case "$line" in "# resolv.conf from "*) if ${new}; then @@ -193,32 +189,29 @@ parse_resolv() "nameserver "*) islocal=false for l in $local_nameservers; do - case "$stripped_line" in + case "${line#* }" in $l) islocal=true + echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS ${line#* }\"" break ;; esac done - if $islocal; then - echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS $stripped_line\"" - else - ns="$ns$stripped_line " - fi + $islocal || ns="$ns${line#* } " ;; "domain "*) - search="$stripped_line" + search="$(strip_trailing_dots ${line#* })" if [ -z "$domain" ]; then domain="$search" echo "DOMAIN=\"$domain\"" fi ;; "search "*) - search="$stripped_line" + search="$(strip_trailing_dots ${line#* })" ;; *) [ -n "$line" ] && continue - if [ -n "$ns" ] && [ -n "$search" ]; then + if [ -n "$ns" -a -n "$search" ]; then newns= for n in $ns; do newns="$newns${newns:+,}$n" @@ -243,7 +236,7 @@ parse_resolv() uniqify() { - result= + local result= while [ -n "$1" ]; do case " $result " in *" $1 "*);; @@ -256,8 +249,8 @@ uniqify() dirname() { - OIFS="$IFS" - IFS=/ + local dir= OIFS="$IFS" + local IFS=/ set -- $@ IFS="$OIFS" if [ -n "$1" ]; then @@ -274,7 +267,7 @@ dirname() config_mkdirs() { - e=0 + local e=0 f d for f; do [ -n "$f" ] || continue d="$(dirname "$f")" @@ -302,86 +295,66 @@ detect_init() # Detect the running init system. # As systemd and OpenRC can be installed on top of legacy init # systems we try to detect them first. - status="@STATUSARG@" + local status="@STATUSARG@" : ${status:=status} - if [ -x /bin/systemctl ] && [ -S /run/systemd/private ]; then - RESTARTCMD=' - if /bin/systemctl --quiet is-active $1.service - then - /bin/systemctl restart $1.service - fi' - elif [ -x /usr/bin/systemctl ] && [ -S /run/systemd/private ]; then - RESTARTCMD=' - if /usr/bin/systemctl --quiet is-active $1.service - then - /usr/bin/systemctl restart $1.service - fi' - elif [ -x /sbin/rc-service ] && - { [ -s /libexec/rc/init.d/softlevel ] || - [ -s /run/openrc/softlevel ]; } + if [ -x /bin/systemctl -a -S /run/systemd/private ]; then + RESTARTCMD="if /bin/systemctl --quiet is-active \$1.service; then + /bin/systemctl restart \$1.service; +fi" + elif [ -x /usr/bin/systemctl -a -S /run/systemd/private ]; then + RESTARTCMD="if /usr/bin/systemctl --quiet is-active \$1.service; then + /usr/bin/systemctl restart \$1.service; +fi" + elif [ -x /sbin/rc-service -a \ + -s /libexec/rc/init.d/softlevel -o -s /run/openrc/softlevel ] then - RESTARTCMD='/sbin/rc-service -i $1 -- -Ds restart' + RESTARTCMD="/sbin/rc-service -i \$1 -- -Ds restart" elif [ -x /usr/sbin/invoke-rc.d ]; then RCDIR=/etc/init.d - RESTARTCMD=' - if /usr/sbin/invoke-rc.d --quiet $1 status >/dev/null 2>&1 - then - /usr/sbin/invoke-rc.d $1 restart - fi' + RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \$1 status 1>/dev/null 2>&1; then + /usr/sbin/invoke-rc.d \$1 restart; +fi" elif [ -x /sbin/service ]; then # Old RedHat RCDIR=/etc/init.d - RESTARTCMD=' - if /sbin/service $1; then - /sbin/service $1 restart - fi' + RESTARTCMD="if /sbin/service \$1; then + /sbin/service \$1 restart; +fi" elif [ -x /usr/sbin/service ]; then # Could be FreeBSD - RESTARTCMD=" - if /usr/sbin/service \$1 $status >/dev/null 2>&1 - then - /usr/sbin/service \$1 restart - fi" + RESTARTCMD="if /usr/sbin/service \$1 $status 1>/dev/null 2>&1; then + /usr/sbin/service \$1 restart; +fi" elif [ -x /bin/sv ]; then - RESTARTCMD='/bin/sv status $1 >/dev/null 2>&1 && - /bin/sv try-restart $1' + RESTARTCMD="/bin/sv status \$1 >/dev/null 2>&1 && /bin/sv try-restart \$1" elif [ -x /usr/bin/sv ]; then - RESTARTCMD='/usr/bin/sv status $1 >/dev/null 2>&1 && - /usr/bin/sv try-restart $1' - elif [ -e /etc/arch-release ] && [ -d /etc/rc.d ]; then + RESTARTCMD="/usr/bin/sv status \$1 >/dev/null 2>&1 && /usr/bin/sv try-restart \$1" + elif [ -e /etc/arch-release -a -d /etc/rc.d ]; then RCDIR=/etc/rc.d - RESTARTCMD=' - if [ -e /var/run/daemons/$1 ] - then - /etc/rc.d/$1 restart - fi' - elif [ -e /etc/slackware-version ] && [ -d /etc/rc.d ]; then - RESTARTCMD=' - if /etc/rc.d/rc.$1 status >/dev/null 2>&1 - then - /etc/rc.d/rc.$1 restart - fi' - elif [ -e /etc/rc.d/rc.subr ] && [ -d /etc/rc.d ]; then + RESTARTCMD="if [ -e /var/run/daemons/\$1 ]; then + /etc/rc.d/\$1 restart; +fi" + elif [ -e /etc/slackware-version -a -d /etc/rc.d ]; then + RESTARTCMD="if /etc/rc.d/rc.\$1 status 1>/dev/null 2>&1; then + /etc/rc.d/rc.\$1 restart; +fi" + elif [ -e /etc/rc.d/rc.subr -a -d /etc/rc.d ]; then # OpenBSD - RESTARTCMD=' - if /etc/rc.d/$1 check >/dev/null 2>&1 - then - /etc/rc.d/$1 restart - fi' + RESTARTCMD="if /etc/rc.d/\$1 check 1>/dev/null 2>&1; then + /etc/rc.d/\$1 restart; +fi" else for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do [ -d $x ] || continue - RESTARTCMD=" - if $x/\$1 $status >/dev/null 2>&1 - then - $x/\$1 restart - fi" + RESTARTCMD="if $x/\$1 $status 1>/dev/null 2>&1; then + $x/\$1 restart; +fi" break done fi if [ -z "$RESTARTCMD" ]; then - if [ "$_NOINIT_WARNED" != true ]; then + if [ "$NOINIT_WARNED" != true ]; then warn "could not detect a useable init system" _NOINIT_WARNED=true fi @@ -393,9 +366,9 @@ detect_init() echo_resolv() { - OIFS="$IFS" + local line= OIFS="$IFS" - [ -n "$1" ] && [ -f "$IFACEDIR/$1" ] || return 1 + [ -n "$1" -a -f "$IFACEDIR/$1" ] || return 1 echo "# resolv.conf from $1" # Our variable maker works of the fact each resolv.conf per interface # is separated by blank lines. @@ -415,16 +388,11 @@ list_resolv() { [ -d "$IFACEDIR" ] || return 0 - cmd="$1" + local report=false list= retval=0 cmd="$1" excl= shift - excl=false - list= - report=false - retval=0 case "$IF_EXCLUSIVE" in *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"