Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/ROY]: src/external/bsd/openresolv/dist Import openresolv-3.6.0 with the ...



details:   https://anonhg.NetBSD.org/src/rev/7f7311b2ac58
branches:  ROY
changeset: 454313:7f7311b2ac58
user:      roy <roy%NetBSD.org@localhost>
date:      Mon Oct 20 09:09:53 2014 +0000

description:
Import openresolv-3.6.0 with the following changes:

  *  dnsmasq subscriber no longer moans if it hasn't written a pidfile
  *  Ensure that name_server_blacklist works for more than one option.
     Thanks to Frederic Barthelery.
  *  unbound_insecure can disable DNSSEC for all domains processed.
  *  local_nameservers now defaults to
     127.* 0.0.0.0 255.255.255.255 ::1
     and is used instead of a hard coded list.
  *  Allow the disabling of resolvconf or optionally an individual
     subscriber.
  *  Don't wait around trying to create a lock if we don't have
     permission.
  *  resolv_conf_passthrough=NULL will update resolv.conf to match
     only what is configured in resolvconf.conf and ignore any
     interface configuration.

diffstat:

 external/bsd/openresolv/dist/dnsmasq.in           |    5 +-
 external/bsd/openresolv/dist/libc.in              |   32 +++-
 external/bsd/openresolv/dist/resolvconf.8.in      |   30 +++-
 external/bsd/openresolv/dist/resolvconf.conf.5.in |   36 ++++-
 external/bsd/openresolv/dist/resolvconf.in        |  160 ++++++++++++++++-----
 external/bsd/openresolv/dist/unbound.in           |    9 +-
 6 files changed, 215 insertions(+), 57 deletions(-)

diffs (truncated from 596 to 300 lines):

diff -r be473520b331 -r 7f7311b2ac58 external/bsd/openresolv/dist/dnsmasq.in
--- a/external/bsd/openresolv/dist/dnsmasq.in   Fri Jul 12 16:50:27 2013 +0000
+++ b/external/bsd/openresolv/dist/dnsmasq.in   Mon Oct 20 09:09:53 2014 +0000
@@ -35,6 +35,7 @@
 
 : ${dnsmasq_pid:=/var/run/dnsmasq.pid}
 [ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid
+[ -s "$dnsmasq_pid" ] || unset dnsmasq_pid
 : ${dnsmasq_service:=dnsmasq}
 : ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@}
 newconf="# Generated by resolvconf$NL"
@@ -182,7 +183,9 @@
        eval $dnsmasq_restart
 fi
 if $dbus; then
-       $changed || kill -HUP $(cat "$dnsmasq_pid")
+       if [ -s "$dnsmasq_pid" ]; then
+               $changed || kill -HUP $(cat "$dnsmasq_pid")
+       fi
        # Send even if empty so old servers are cleared
        if $dbus_ex; then
                method=SetDomainServers
diff -r be473520b331 -r 7f7311b2ac58 external/bsd/openresolv/dist/libc.in
--- a/external/bsd/openresolv/dist/libc.in      Fri Jul 12 16:50:27 2013 +0000
+++ b/external/bsd/openresolv/dist/libc.in      Mon Oct 20 09:09:53 2014 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2007-2012 Roy Marples
+# Copyright (c) 2007-2014 Roy Marples
 # All rights reserved
 
 # libc subscriber for resolvconf
@@ -72,6 +72,8 @@
        done
 }
 
+local_nameservers="127.* 0.0.0.0 255.255.255.255 ::1"
+
 # Support original resolvconf configuration layout
 # as well as the openresolv config file
 if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then
@@ -93,7 +95,6 @@
                resolv_conf_tail="$(cat "$SYSCONFDIR"/resolv.conf.d/tail)"
        fi
 fi
-: ${domain:=$DOMAIN}
 : ${resolv_conf:=/etc/resolv.conf}
 : ${libc_service:=nscd}
 : ${libc_restart:=@RESTARTCMD ${libc_service}@}
@@ -129,22 +130,41 @@
        [ -z "$newest" ] && exit 0
        newconf="$(cat "$newest")$NL"
        ;;
+/dev/null|[Nn][Uu][Ll][Ll])
+       : ${resolv_conf_local_only:=NO}
+       if [ "$local_nameservers" = "127.* 0.0.0.0 255.255.255.255 ::1" ]; then
+               local_nameservers=
+       fi
+       # Need to overwrite our variables.
+       eval "$(@SBINDIR@/resolvconf -V)"
+       ;;
+
 *)
        [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)"
+       ;;
+esac
+case "${resolv_conf_passthrough:-NO}" in
+[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;;
+*)
+       : ${domain:=$DOMAIN}
        newsearch="$(uniqify $prepend_search $SEARCH)"
        NS="$LOCALNAMESERVERS $NAMESERVERS"
        newns=
        gotlocal=false
        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;;
-               *)
+               islocal=false
+               for l in $local_nameservers; do
+                       case "$n" in
+                       $l) islocal=true; gotlocal=true; break;;
+                       esac
+               done
+               if ! $islocal; then
                        case "${resolv_conf_local_only:-YES}" in
                        [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
                                $gotlocal && add=false;;
                        esac
-               esac
+               fi
                $add && newns="$newns $n"
        done
 
diff -r be473520b331 -r 7f7311b2ac58 external/bsd/openresolv/dist/resolvconf.8.in
--- a/external/bsd/openresolv/dist/resolvconf.8.in      Fri Jul 12 16:50:27 2013 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.8.in      Mon Oct 20 09:09:53 2014 +0000
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2007-2012 Roy Marples
+.\" Copyright (c) 2007-2014 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 March 19, 2012
+.Dd October 20, 2014
 .Dt RESOLVCONF 8 SMM
 .Os
 .Sh NAME
@@ -78,6 +78,20 @@
 will supply files that the resolver should be configured to include.
 .Pp
 .Nm
+assumes it has a job to do.
+In some situations
+.Nm
+needs to act as a deterent to writing to
+.Pa /etc/resolv.conf .
+Where this file cannot be made immutable or you just need to toggle this
+behaviour,
+.Nm
+can be disabled by adding
+.Sy resolvconf Ns = Ns NO
+to
+.Xr resolvconf.conf 5 .
+.Pp
+.Nm
 can mark an interfaces
 .Pa resolv.conf
 as private.
@@ -142,18 +156,24 @@
 .It Fl u
 Force
 .Nm
-to update all it's subscribers.
+to update all its subscribers.
 .Nm
 does not update the subscribers when adding a resolv.conf that matches
 what it already has for that interface.
 .El
 .Pp
 .Nm
-also has some options designed to be used by it's subscribers:-
+also has some options designed to be used by its subscribers:-
 .Bl -tag -width indent
 .It Fl v
 Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can
 configure the resolver easily.
+.It Fl V
+Same as
+.Fl v
+except that only the information configured in
+.Xr resolvconf.conf 5
+is set.
 .El
 .Sh INTERFACE ORDERING
 For
@@ -224,7 +244,7 @@
 .Xr resolver 3 ,
 .Xr stdin 3
 .Sh AUTHORS
-.An Roy Marples Aq roy%marples.name@localhost
+.An Roy Marples Aq Mt roy%marples.name@localhost
 .Sh BUGS
 Please report them to
 .Lk http://roy.marples.name/projects/openresolv
diff -r be473520b331 -r 7f7311b2ac58 external/bsd/openresolv/dist/resolvconf.conf.5.in
--- a/external/bsd/openresolv/dist/resolvconf.conf.5.in Fri Jul 12 16:50:27 2013 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.conf.5.in Mon Oct 20 09:09:53 2014 +0000
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2009-2013 Roy Marples
+.\" Copyright (c) 2009-2014 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 April 27, 2013
+.Dd October 20, 2014
 .Dt RESOLVCONF.CONF 5 SMM
 .Os
 .Sh NAME
@@ -42,12 +42,19 @@
 Listed below are the standard
 .Nm
 variables that may be set.
+If the values contain white space for special shell characters,
+ensure they are quoted and escaped correctly.
 .Pp
 After updating this file, you may wish to run
 .Nm resolvconf -u
 to apply the new configuration.
 .Sh RESOLVCONF OPTIONS
 .Bl -tag -width indent
+.It Sy resolvconf
+Set to NO to disable
+.Nm resolvconf
+from running any subscribers.
+Defaults to YES.
 .It Sy interface_order
 These interfaces will always be processed first.
 If unset, defaults to the following:-
@@ -56,6 +63,9 @@
 These interfaces will be processed next, unless they have a metric.
 If unset, defaults to the following:-
 .D1 tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]*
+.It Sy local_nameservers
+If unset, defaults to the following:-
+.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
@@ -104,6 +114,14 @@
 When set to YES the latest resolv.conf is written to
 .Sy resolv_conf
 without any alteration.
+When set to /dev/null or NULL,
+.Sy resolv_conf_local_only
+is defaulted to NO,
+.Sy local_nameservers
+is unset unless overriden and only the information set in
+.Nm
+is written to
+.Sy resolv_conf .
 .It Sy resolv_conf_sortlist
 A libc resolver sortlist, as specified in
 .Xr resolv.conf 5 .
@@ -124,6 +142,10 @@
 .Xr unbound 8 .
 Each subscriber can create configuration files which should be included in
 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:
+.D1 libc=NO
 .Bl -tag -width indent
 .It Sy dnsmasq_conf
 This file tells dnsmasq which name servers to use for specific domains.
@@ -190,6 +212,8 @@
 .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:
 .D1 name_servers=127.0.0.1
@@ -234,12 +258,14 @@
 Command to restart the unbound service.
 .It Sy unbound_pid
 Location of the unbound pidfile.
+.El
 .Sh SEE ALSO
-.Xr resolv.conf 5
+.Xr resolv.conf 5 ,
+.Xr resolvconf 8
 and
-.Xr resolvconf 8 .
+.Xr sh 1 .
 .Sh AUTHORS
-.An Roy Marples Aq roy%marples.name@localhost
+.An Roy Marples Aq Mt roy%marples.name@localhost
 .Sh BUGS
 Each distribution is a special snowflake and likes to name the same thing
 differently, namely the named service script.
diff -r be473520b331 -r 7f7311b2ac58 external/bsd/openresolv/dist/resolvconf.in
--- a/external/bsd/openresolv/dist/resolvconf.in        Fri Jul 12 16:50:27 2013 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.in        Mon Oct 20 09:09:53 2014 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2007-2012 Roy Marples
+# Copyright (c) 2007-2014 Roy Marples
 # All rights reserved
 
 # Redistribution and use in source and binary forms, with or without
@@ -32,6 +32,13 @@
 # Disregard dhcpcd setting
 unset interface_order state_dir
 
+# If you change this, change the test in VFLAG and libc.in as well
+local_nameservers="127.* 0.0.0.0 255.255.255.255 ::1"
+
+dynamic_order="tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]*"
+interface_order="lo lo[0-9]*"
+name_server_blacklist="0.0.0.0"
+
 # Support original resolvconf configuration layout
 # as well as the openresolv config file
 if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then
@@ -43,13 +50,16 @@
                interface_order="$(cat "$SYSCONFDIR"/interface-order)"
        fi
 fi
+TMPDIR="$VARDIR/tmp"



Home | Main Index | Thread Index | Old Index