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.9.0 with the ...



details:   https://anonhg.NetBSD.org/src/rev/d8cd2b9cfefb
branches:  ROY
changeset: 454319:d8cd2b9cfefb
user:      roy <roy%NetBSD.org@localhost>
date:      Fri Dec 30 19:42:05 2016 +0000

description:
Import openresolv-3.9.0 with the following changes:
  *  Added --version option
  *  Fix pdns_recursor restart command
  *  Append a newline when restoring resolv.conf
  *  public_interfaces overrides private interface markings
  *  Fix runit support
  *  inclusive_interfaces overrides exclusive interface markings

diffstat:

 external/bsd/openresolv/dist/libc.in              |   2 +-
 external/bsd/openresolv/dist/resolvconf.8.in      |  33 ++++++----
 external/bsd/openresolv/dist/resolvconf.conf.5.in |  18 ++++-
 external/bsd/openresolv/dist/resolvconf.in        |  70 +++++++++++++++++-----
 4 files changed, 86 insertions(+), 37 deletions(-)

diffs (truncated from 336 to 300 lines):

diff -r 2a0aed990fe4 -r d8cd2b9cfefb external/bsd/openresolv/dist/libc.in
--- a/external/bsd/openresolv/dist/libc.in      Mon Apr 11 10:40:21 2016 +0000
+++ b/external/bsd/openresolv/dist/libc.in      Fri Dec 30 19:42:05 2016 +0000
@@ -216,7 +216,7 @@
 if $backup; then
        if [ "$newconf" = "$signature$NL" ]; then
                if [ -e "$resolv_conf.bak" ]; then
-                       newconf="$(cat "$resolv_conf.bak")"
+                       newconf="$(cat "$resolv_conf.bak")$NL"
                fi
        elif [ -e "$resolv_conf" ]; then
                read line <"$resolv_conf"
diff -r 2a0aed990fe4 -r d8cd2b9cfefb external/bsd/openresolv/dist/resolvconf.8.in
--- a/external/bsd/openresolv/dist/resolvconf.8.in      Mon Apr 11 10:40:21 2016 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.8.in      Fri Dec 30 19:42:05 2016 +0000
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 23, 2016
+.Dd November 29, 2016
 .Dt RESOLVCONF 8
 .Os
 .Sh NAME
@@ -45,6 +45,8 @@
 .Fl il Ar pattern
 .Nm
 .Fl u
+.Nm
+.Fl Fl version
 .Sh DESCRIPTION
 .Nm
 manages
@@ -64,7 +66,7 @@
 file to
 .Nm
 via
-.Xr stdin 3
+.Xr stdin 4
 with the argument
 .Fl a Ar interface Ns Op Ar .protocol
 instead of the filesystem.
@@ -101,12 +103,12 @@
 This means that the name servers listed in that
 .Pa resolv.conf
 are only used for queries against the domain/search listed in the same file.
-This only works when a local resolver other than libc is installed. 
+This only works when a local resolver other than libc is installed.
 See
 .Xr resolvconf.conf 5
 for how to configure
 .Nm
-to use a local name server.
+to use a local name server and how to remove the private marking.
 .Pp
 .Nm
 can mark an interfaces
@@ -126,9 +128,9 @@
 .Ar interface .
 .Pp
 Here are some options for the above commands:-
-.Bl -tag -width indent
+.Bl -tag -width pattern_opt
 .It Fl f
-Ignore non existant interfaces.
+Ignore non existent interfaces.
 Only really useful for deleting interfaces.
 .It Fl m Ar metric
 Set the metric of the interface when adding it, default of 0.
@@ -146,7 +148,7 @@
 .Pp
 .Nm
 has some more commands for general usage:-
-.Bl -tag -width indent
+.Bl -tag -width pattern_opt
 .It Fl i Ar pattern
 List the interfaces and protocols, optionally matching
 .Ar pattern ,
@@ -168,12 +170,15 @@
 .Nm
 does not update the subscribers when adding a resolv.conf that matches
 what it already has for that interface.
+.It Fl Fl version
+Echo the resolvconf version to
+.Em stdout .
 .El
 .Pp
 .Nm
 also has some commands designed to be used by it's subscribers and
 system startup:-
-.Bl -tag -width indent
+.Bl -tag -width pattern_opt
 .It Fl I
 Initialise the state directory
 .Pa @VARDIR@ .
@@ -223,7 +228,7 @@
 .Pa resolv.conf
 file registered on an
 .Ar interface Ns No :-
-.Bl -tag -width indent
+.Bl -tag -width pattern_opt
 .It dhcp
 Dynamic Host Configuration Protocol.
 Initial versions of
@@ -290,16 +295,16 @@
 State directory for
 .Nm .
 .El
+.Sh SEE ALSO
+.Xr resolver 3 ,
+.Xr stdin 4 ,
+.Xr resolv.conf 5 ,
+.Xr resolvconf.conf 5
 .Sh HISTORY
 This implementation of
 .Nm
 is called openresolv and is fully command line compatible with Debian's
 resolvconf, as written by Thomas Hood.
-.Sh SEE ALSO
-.Xr resolv.conf 5 ,
-.Xr resolvconf.conf 5 ,
-.Xr resolver 3 ,
-.Xr stdin 3
 .Sh AUTHORS
 .An Roy Marples Aq Mt roy%marples.name@localhost
 .Sh BUGS
diff -r 2a0aed990fe4 -r d8cd2b9cfefb external/bsd/openresolv/dist/resolvconf.conf.5.in
--- a/external/bsd/openresolv/dist/resolvconf.conf.5.in Mon Apr 11 10:40:21 2016 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.conf.5.in Fri Dec 30 19:42:05 2016 +0000
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 23, 2016
+.Dd December 29, 2016
 .Dt RESOLVCONF.CONF 5
 .Os
 .Sh NAME
@@ -69,6 +69,11 @@
 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 inclusive_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:-
 .D1 127.* 0.0.0.0 255.255.255.255 ::1
@@ -102,8 +107,14 @@
 This is equivalent to the
 .Nm resolvconf -p
 option.
+.It Sy public_interfaces
+Force these interface to be public, overriding the private marking.
+This is handy when 3rd party integrations force the
+.Nm resolvconf -p
+option and you want to disable it easily.
 .It Sy replace
-Is a space separated list of replacement keywords. The syntax is this:
+Is a space separated list of replacement keywords.
+The syntax is this:
 .Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement
 .Pp
 Example, given this resolv.conf:
@@ -307,10 +318,9 @@
 Location of the unbound pidfile.
 .El
 .Sh SEE ALSO
+.Xr sh 1 ,
 .Xr resolv.conf 5 ,
 .Xr resolvconf 8
-and
-.Xr sh 1 .
 .Sh AUTHORS
 .An Roy Marples Aq Mt roy%marples.name@localhost
 .Sh BUGS
diff -r 2a0aed990fe4 -r d8cd2b9cfefb external/bsd/openresolv/dist/resolvconf.in
--- a/external/bsd/openresolv/dist/resolvconf.in        Mon Apr 11 10:40:21 2016 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.in        Fri Dec 30 19:42:05 2016 +0000
@@ -25,13 +25,19 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 RESOLVCONF="$0"
-OPENRESOLV_VERSION="3.8.0"
+OPENRESOLV_VERSION="3.9.0"
 SYSCONFDIR=@SYSCONFDIR@
 LIBEXECDIR=@LIBEXECDIR@
 VARDIR=@VARDIR@
 RCDIR=@RCDIR@
 RESTARTCMD=@RESTARTCMD@
 
+if [ "$1" = "--version" ]; then
+       echo "openresolv $OPENRESOLV_VERSION"
+       echo "Copyright (c) 2007-2016 Roy Marples"
+       exit 0
+fi
+
 # Disregard dhcpcd setting
 unset interface_order state_dir
 
@@ -90,9 +96,10 @@
                           that match the specified pattern
 
          -u               Run updates from our current DNS information
+         --version        Echo the ${RESOLVCONF##*/} version
 
        Options:
-         -f               Ignore non existant interfaces
+         -f               Ignore non existent interfaces
          -m metric        Give the added DNS information a metric
          -p               Mark the interface as private
          -x               Mark the interface as exclusive
@@ -129,6 +136,34 @@
        printf "\n"
 }
 
+private_iface()
+{
+       local p
+
+       # Allow expansion
+       cd "$IFACEDIR"
+
+       # Public interfaces override private ones.
+       for p in $public_interfaces; do
+               case "$iface" in
+               "$p"|"$p":*) return 1;;
+               esac
+       done
+
+       if [ -e "$PRIVATEDIR/$iface" ]; then
+               return 0
+       fi
+       
+       for p in $private_interfaces; do
+               case "$iface" in
+               "$p"|"$p":*) return 0;;
+               esac
+       done
+
+       # Not a private interface
+       return 1
+}
+
 # Parse resolv.conf's and make variables
 # for domain name servers, search name servers and global nameservers
 parse_resolv()
@@ -144,17 +179,10 @@
                        if ${new}; then
                                iface="${line#\# resolv.conf from *}"
                                new=false
-                               if [ -e "$PRIVATEDIR/$iface" ]; then
+                               if private_iface "$iface"; then
                                        private=true
                                else
-                                       # Allow expansion
-                                       cd "$IFACEDIR"
                                        private=false
-                                       for p in $private_interfaces; do
-                                               case "$iface" in
-                                               "$p"|"$p":*) private=true; break;;
-                                               esac
-                                       done
                                fi
                        fi
                        ;;
@@ -270,11 +298,11 @@
        local status="@STATUSARG@"
        : ${status:=status}
        if [ -x /bin/systemctl -a -S /run/systemd/private ]; then
-               RESTARTCMD="if /bin/systemctl --quiet is-active; 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; 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 \
@@ -298,9 +326,9 @@
        /usr/sbin/service \$1 restart;
 fi"
        elif [ -x /bin/sv ]; then
-               RESTARTCMD="/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 try-restart \$1"
+               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
@@ -375,6 +403,14 @@
                        done
                fi
                excl=true
+               cd "$IFACEDIR"
+               for i in $inclusive_interfaces; do



Home | Main Index | Thread Index | Old Index