Module Name: src Committed By: yamt Date: Thu May 22 15:50:52 UTC 2014
Modified Files: src/external/bsd/openresolv/dist [yamt-pagecache]: dnsmasq.in libc.in named.in pdnsd.in resolvconf.8.in resolvconf.conf.5.in resolvconf.in unbound.in src/external/bsd/openresolv/sbin/resolvconf [yamt-pagecache]: Makefile Log Message: sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") To generate a diff of this commit: cvs rdiff -u -r1.1.1.3.2.2 -r1.1.1.3.2.3 \ src/external/bsd/openresolv/dist/dnsmasq.in \ src/external/bsd/openresolv/dist/named.in \ src/external/bsd/openresolv/dist/resolvconf.in cvs rdiff -u -r1.1.1.3.2.1 -r1.1.1.3.2.2 \ src/external/bsd/openresolv/dist/libc.in \ src/external/bsd/openresolv/dist/resolvconf.8.in \ src/external/bsd/openresolv/dist/unbound.in cvs rdiff -u -r1.1.1.1.4.1 -r1.1.1.1.4.2 \ src/external/bsd/openresolv/dist/pdnsd.in cvs rdiff -u -r1.3.2.2 -r1.3.2.3 \ src/external/bsd/openresolv/dist/resolvconf.conf.5.in cvs rdiff -u -r1.3.6.1 -r1.3.6.2 \ src/external/bsd/openresolv/sbin/resolvconf/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/openresolv/dist/dnsmasq.in diff -u src/external/bsd/openresolv/dist/dnsmasq.in:1.1.1.3.2.2 src/external/bsd/openresolv/dist/dnsmasq.in:1.1.1.3.2.3 --- src/external/bsd/openresolv/dist/dnsmasq.in:1.1.1.3.2.2 Wed Jan 16 05:28:00 2013 +++ src/external/bsd/openresolv/dist/dnsmasq.in Thu May 22 15:50:52 2014 @@ -29,7 +29,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$dnsmasq_conf" -a -z "$dnsmasq_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -47,23 +47,17 @@ newresolv="$newconf" # Check for DBus support in the binary dbus=false dbus_ex=false -: ${dbus_pid:=/var/run/dbus/dbus.pid} -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus.pid -[ -s "$dbus_pid" ] || dbus_pid=/var/run/dbus/pid -if [ -s "$dbus_pid" -a -s "$dnsmasq_pid" ]; then - if dnsmasq --version 2>/dev/null | \ - grep -q "^Compile time options.*[[:space:]]DBus[[:space:]]" +dbus_introspect=$(dbus-send --print-reply --system \ + --dest=uk.org.thekelleys.dnsmasq \ + /uk/org/thekelleys/dnsmasq \ + org.freedesktop.DBus.Introspectable.Introspect \ + 2>/dev/null) +if [ $? = 0 ]; then + dbus=true + if printf %s "$dbus_introspect" | \ + grep -q '<method name="SetDomainServers">' then - # Sanity - check that dnsmasq and dbus are running - if kill -0 $(cat "$dbus_pid") 2>/dev/null && \ - kill -0 $(cat "$dnsmasq_pid") 2>/dev/null - then - dbus=true - if dbus-send --print-reply --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq org.freedesktop.DBus.Introspectable.Introspect | grep -q '<method name="SetDomainServers">' - then - dbus_ex=true - fi - fi + dbus_ex=true fi fi @@ -151,7 +145,7 @@ done if $dbus; then newconf="$newconf$NL# Domain specific servers will" - newconf="$newconf be sent over dbus${NL}enable-dbus$NL" + newconf="$newconf be sent over dbus${NL}" else newconf="$newconf$conf" fi @@ -160,7 +154,7 @@ fi if type config_mkdirs >/dev/null 2>&1; then config_mkdirs "$dnsmasq_conf" "$dnsmasq_resolv" else - @PREFIX@/sbin/resolvconf -D "$dnsmasq_conf" "$dnsmasq_resolv" + @SBINDIR@/resolvconf -D "$dnsmasq_conf" "$dnsmasq_resolv" fi changed=false Index: src/external/bsd/openresolv/dist/named.in diff -u src/external/bsd/openresolv/dist/named.in:1.1.1.3.2.2 src/external/bsd/openresolv/dist/named.in:1.1.1.3.2.3 --- src/external/bsd/openresolv/dist/named.in:1.1.1.3.2.2 Wed Jan 16 05:28:00 2013 +++ src/external/bsd/openresolv/dist/named.in Thu May 22 15:50:52 2014 @@ -29,7 +29,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$named_zones" -a -z "$named_options" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -78,7 +78,7 @@ done if type config_mkdirs >/dev/null 2>&1; then config_mkdirs "$named_options" "$named_zones" else - @PREFIX@/sbin/resolvconf -D "$named_options" "$named_zones" + @SBINDIR@/resolvconf -D "$named_options" "$named_zones" fi # No point in changing files or reloading bind if the end result has not Index: src/external/bsd/openresolv/dist/resolvconf.in diff -u src/external/bsd/openresolv/dist/resolvconf.in:1.1.1.3.2.2 src/external/bsd/openresolv/dist/resolvconf.in:1.1.1.3.2.3 --- src/external/bsd/openresolv/dist/resolvconf.in:1.1.1.3.2.2 Wed Jan 16 05:28:00 2013 +++ src/external/bsd/openresolv/dist/resolvconf.in Thu May 22 15:50:52 2014 @@ -28,6 +28,10 @@ RESOLVCONF="$0" SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ + +# Disregard dhcpcd setting +unset interface_order state_dir + # Support original resolvconf configuration layout # as well as the openresolv config file if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then @@ -111,18 +115,6 @@ parse_resolv() local line= ns= ds= search= d= n= newns= local new=true iface= private=false p= domain= - echo "DOMAIN=" - echo "DOMAINS=" - echo "SEARCH=\"$search_domains\"" - # let our subscribers know about global nameservers - for n in $name_servers; do - case "$n" in - 127.*|0.0.0.0|255.255.255.255|::1) :;; - *) newns="$newns${newns:+ }$n";; - esac - done - echo "NAMESERVERS=\"$newns\"" - echo "LOCALNAMESERVERS=" newns= while read -r line; do @@ -324,10 +316,48 @@ list_remove() { return $retval } +echo_prepend() +{ + echo "# Generated by resolvconf" + if [ -n "$search_domains" ]; then + echo "search $search_domains" + fi + for n in $name_servers; do + echo "nameserver $n" + done + echo +} + +echo_append() +{ + echo "# Generated by resolvconf" + if [ -n "$search_domains_append" ]; then + echo "search $search_domains_append" + fi + for n in $name_servers_append; do + echo "nameserver $n" + done + echo +} + make_vars() { local newdomains= d= dn= newns= ns= + + # Clear variables + DOMAIN= + DOMAINS= + SEARCH= + NAMESERVERS= + LOCALNAMESERVERS= + + if [ -n "$name_servers" -o -n "$search_domains" ]; then + eval "$(echo_prepend | parse_resolv)" + fi eval "$(list_resolv -l "$@" | parse_resolv)" + if [ -n "$name_servers_append" -o -n "$search_domains_append" ]; then + eval "$(echo_append | parse_resolv)" + fi # Ensure that we only list each domain once for d in $DOMAINS; do Index: src/external/bsd/openresolv/dist/libc.in diff -u src/external/bsd/openresolv/dist/libc.in:1.1.1.3.2.1 src/external/bsd/openresolv/dist/libc.in:1.1.1.3.2.2 --- src/external/bsd/openresolv/dist/libc.in:1.1.1.3.2.1 Tue Apr 17 00:04:01 2012 +++ src/external/bsd/openresolv/dist/libc.in Thu May 22 15:50:52 2014 @@ -80,9 +80,9 @@ elif [ -d "$SYSCONFDIR"/resolvconf ]; th SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d" base="$SYSCONFDIR/resolv.conf.d/base" if [ -f "$base" ]; then - name_servers="$(key_get_value "nameserver " "$base")" + prepend_nameservers="$(key_get_value "nameserver " "$base")" domain="$(key_get_value "domain " "$base")" - search_domains="$(key_get_value "search " "$base")" + prepend_search="$(key_get_value "search " "$base")" resolv_conf_options="$(key_get_value "options " "$base")" resolv_conf_sortlist="$(key_get_value "sortlist " "$base")" fi @@ -97,7 +97,7 @@ fi : ${resolv_conf:=/etc/resolv.conf} : ${libc_service:=nscd} : ${libc_restart:=@RESTARTCMD ${libc_service}@} -: ${list_resolv:=@PREFIX@/sbin/resolvconf -l} +: ${list_resolv:=@SBINDIR@/resolvconf -l} if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)" fi @@ -130,12 +130,12 @@ case "${resolv_conf_passthrough:-NO}" in newconf="$(cat "$newest")$NL" ;; *) - [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" - newsearch="$(uniqify $search_domains $SEARCH $search_domains_append)" + [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" + newsearch="$(uniqify $prepend_search $SEARCH)" NS="$LOCALNAMESERVERS $NAMESERVERS" newns= gotlocal=false - for n in $(uniqify $name_servers $NS $name_servers_append); do + for n in $(uniqify $prepend_nameservers $NS); do add=true case "$n" in 127.*|0.0.0.0|255.255.255.255|::1) gotlocal=true;; Index: src/external/bsd/openresolv/dist/resolvconf.8.in diff -u src/external/bsd/openresolv/dist/resolvconf.8.in:1.1.1.3.2.1 src/external/bsd/openresolv/dist/resolvconf.8.in:1.1.1.3.2.2 --- src/external/bsd/openresolv/dist/resolvconf.8.in:1.1.1.3.2.1 Tue Apr 17 00:04:02 2012 +++ src/external/bsd/openresolv/dist/resolvconf.8.in Thu May 22 15:50:52 2014 @@ -224,7 +224,7 @@ resolvconf, as written by Thomas Hood. .Xr resolver 3 , .Xr stdin 3 .Sh AUTHORS -.An Roy Marples Aq r...@marples.name +.An Roy Marples Aq Mt r...@marples.name .Sh BUGS Please report them to .Lk http://roy.marples.name/projects/openresolv Index: src/external/bsd/openresolv/dist/unbound.in diff -u src/external/bsd/openresolv/dist/unbound.in:1.1.1.3.2.1 src/external/bsd/openresolv/dist/unbound.in:1.1.1.3.2.2 --- src/external/bsd/openresolv/dist/unbound.in:1.1.1.3.2.1 Tue Apr 17 00:04:02 2012 +++ src/external/bsd/openresolv/dist/unbound.in Thu May 22 15:50:52 2014 @@ -29,7 +29,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$unbound_conf" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -60,7 +60,7 @@ fi if type config_mkdirs >/dev/null 2>&1; then config_mkdirs "$unbound_conf" else - @PREFIX@/sbin/resolvconf -D "$unbound_conf" + @SBINDIR@/resolvconf -D "$unbound_conf" fi if [ ! -f "$unbound_conf" ] || \ Index: src/external/bsd/openresolv/dist/pdnsd.in diff -u src/external/bsd/openresolv/dist/pdnsd.in:1.1.1.1.4.1 src/external/bsd/openresolv/dist/pdnsd.in:1.1.1.1.4.2 --- src/external/bsd/openresolv/dist/pdnsd.in:1.1.1.1.4.1 Tue Apr 17 00:04:02 2012 +++ src/external/bsd/openresolv/dist/pdnsd.in Thu May 22 15:50:52 2014 @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2010-2011 Roy Marples +# Copyright (c) 2010-2013 Roy Marples # All rights reserved # pdnsd subscriber for resolvconf @@ -29,7 +29,7 @@ [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0 . "@SYSCONFDIR@/resolvconf.conf" || exit 1 [ -z "$pdnsd_conf" -a -z "$pdnsd_resolv" ] && exit 0 -[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)" +[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)" NL=" " @@ -82,19 +82,19 @@ change_file() return 0 } -newresolv="# Generated by resolvconf\n" +newresolv="# Generated by resolvconf$NL" changed=false # Try to ensure that config dirs exist if type config_mkdirs >/dev/null 2>&1; then config_mkdirs "$pdnsd_resolv" "$pdnsd_conf" else - @PREFIX@/sbin/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf" + @SBINDIR@/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf" fi if [ -n "$pdnsd_resolv" ]; then for n in $NAMESERVERS; do - newresolv="${newresolv}nameserver $n\n" + newresolv="${newresolv}nameserver $n$NL" done fi @@ -146,7 +146,7 @@ if [ -w "$pdnsd_conf" ]; then fi if change_file "$pdnsd_conf" "$cf"; then changed=true - fi + fi fi if [ -n "$pdnsd_resolv" ]; then Index: src/external/bsd/openresolv/dist/resolvconf.conf.5.in diff -u src/external/bsd/openresolv/dist/resolvconf.conf.5.in:1.3.2.2 src/external/bsd/openresolv/dist/resolvconf.conf.5.in:1.3.2.3 --- src/external/bsd/openresolv/dist/resolvconf.conf.5.in:1.3.2.2 Wed Jan 16 05:28:00 2013 +++ src/external/bsd/openresolv/dist/resolvconf.conf.5.in Thu May 22 15:50:52 2014 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009-2012 Roy Marples +.\" Copyright (c) 2009-2013 Roy Marples .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 2, 2012 +.Dd April 27, 2013 .Dt RESOLVCONF.CONF 5 SMM .Os .Sh NAME @@ -108,11 +108,12 @@ without any alteration. A libc resolver sortlist, as specified in .Xr resolv.conf 5 . .It Sy resolv_conf_local_only -If a local nameserver is configured then the default is just to specify that +If a local name server is configured then the default is just to specify that and ignore all other entries as they will be configured for the local -nameserver. -Set this to YES to list them instead, if you need working DNS and the local -nameserver stops functioning at the expense of duplicated server queries. +name server. +Set this to NO to also list non-local nameservers. +This will give you working DNS even if the local nameserver stops functioning +at the expense of duplicated server queries. .El .Sh SUBSCRIBER OPTIONS openresolv ships with subscribers for the name servers @@ -125,28 +126,31 @@ Each subscriber can create configuration in the subscribers main configuration file. .Bl -tag -width indent .It Sy dnsmasq_conf -This file tells dnsmasq which nameservers to use for specific domains. +This file tells dnsmasq which name servers to use for specific domains. .It Sy dnsmasq_resolv -This file tells dnsmasq which nameservers to use for global lookups. +This file tells dnsmasq which name servers to use for global lookups. .Pp Example resolvconf.conf for dnsmasq: -.D1 nameservers=127.0.0.1 +.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: .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 nameservers to use for global lookups. +This file tells named which name servers to use for global lookups. .It Sy named_zones Include this file in the named global scope, after the options block. -This file tells named which nameservers to use for specific domains. +This file tells named which name servers to use for specific domains. .Pp Example resolvconf.conf for named: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 named_options=/etc/named-options.conf .D1 named_zones=/etc/named-zones.conf .Pp @@ -164,12 +168,12 @@ setup to read .Pa pdnsd_resolv as documented below. .It Sy pdnsd_resolv -This file tells pdnsd about global nameservers. +This file tells pdnsd about global name servers. If this variable is not set then it's written to .Pa pdnsd_conf . .Pp Example resolvconf.conf for pdnsd: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 pdnsd_conf=/etc/pdnsd.conf .D1 # pdnsd_resolv=/etc/pdnsd-resolv.conf .Pp @@ -185,10 +189,10 @@ Example pdnsd.conf: .D1 # file="/etc/pdnsd-resolv.conf"; .D1 } .It Sy unbound_conf -This file tells unbound about specific and global nameservers. +This file tells unbound about specific and global name servers. .Pp Example resolvconf.conf for unbound: -.D1 nameservers=127.0.0.1 +.D1 name_servers=127.0.0.1 .D1 unbound_conf=/etc/unbound-resolvconf.conf .Pp Example unbound.conf: @@ -208,8 +212,6 @@ To accomodate this, the subscribers have variables, documented below. .Pp .Bl -tag -width indent -.It Sy dbus_pid -Locaiton of the dbus pidfile. .It Sy dnsmasq_service Location of the dnsmasq service. .It Sy dnsmasq_restart @@ -232,15 +234,16 @@ Location of the unbound service. Command to restart the unbound service. .It Sy unbound_pid Location of the unbound pidfile. +.El .Sh SEE ALSO .Xr resolv.conf 5 and .Xr resolvconf 8 . .Sh AUTHORS -.An Roy Marples Aq r...@marples.name +.An Roy Marples Aq Mt r...@marples.name .Sh BUGS Each distribution is a special snowflake and likes to name the same thing -differently, namely the named service script and the dbus pidfile location. +differently, namely the named service script. .Pp Please report them to .Lk http://roy.marples.name/projects/openresolv Index: src/external/bsd/openresolv/sbin/resolvconf/Makefile diff -u src/external/bsd/openresolv/sbin/resolvconf/Makefile:1.3.6.1 src/external/bsd/openresolv/sbin/resolvconf/Makefile:1.3.6.2 --- src/external/bsd/openresolv/sbin/resolvconf/Makefile:1.3.6.1 Tue Apr 17 00:04:02 2012 +++ src/external/bsd/openresolv/sbin/resolvconf/Makefile Thu May 22 15:50:52 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3.6.1 2012/04/17 00:04:02 yamt Exp $ +# $NetBSD: Makefile,v 1.3.6.2 2014/05/22 15:50:52 yamt Exp $ # .include <bsd.own.mk> @@ -26,6 +26,8 @@ RESTARTCMD= if /etc/rc.d/${CMD1}; then / .for f in ${SCRIPTS} ${FILES} ${MAN} ${f}: Makefile ${f}.in ${TOOL_SED} -e 's:@PREFIX@::g' \ + -e 's:@SBINDIR@:/sbin:g' \ + -e 's:@RCDIR@:/etc/rc.d:g' \ -e 's:@SYSCONFDIR@:/etc:g' \ -e 's:@LIBEXECDIR@:/libexec/resolvconf:g' \ -e 's:@VARDIR@:/var/run/resolvconf:g' \