Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/openresolv/dist Sync with openresolv-3.13.2



details:   https://anonhg.NetBSD.org/src/rev/21e3d2ebc894
branches:  trunk
changeset: 376656:21e3d2ebc894
user:      roy <roy%NetBSD.org@localhost>
date:      Tue Jun 27 17:07:53 2023 +0000

description:
Sync with openresolv-3.13.2

diffstat:

 external/bsd/openresolv/dist/dnsmasq.in           |   8 +++---
 external/bsd/openresolv/dist/libc.in              |  27 +++++++++++++++++---
 external/bsd/openresolv/dist/named.in             |   4 +-
 external/bsd/openresolv/dist/pdnsd.in             |  10 +++---
 external/bsd/openresolv/dist/resolvconf.8.in      |   6 ++--
 external/bsd/openresolv/dist/resolvconf.conf.5.in |  19 ++++++++++---
 external/bsd/openresolv/dist/resolvconf.in        |  30 ++++++++++++++++------
 external/bsd/openresolv/dist/unbound.in           |  10 ++++++-
 8 files changed, 81 insertions(+), 33 deletions(-)

diffs (truncated from 384 to 300 lines):

diff -r b7ae6464da34 -r 21e3d2ebc894 external/bsd/openresolv/dist/dnsmasq.in
--- a/external/bsd/openresolv/dist/dnsmasq.in   Tue Jun 27 17:04:19 2023 +0000
+++ b/external/bsd/openresolv/dist/dnsmasq.in   Tue Jun 27 17:07:53 2023 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2007-2020 Roy Marples
+# Copyright (c) 2007-2023 Roy Marples
 # All rights reserved
 
 # dnsmasq subscriber for resolvconf
@@ -105,7 +105,7 @@ for d in $DOMAINS; do
                                                empty=true
                                                continue
                                        fi
-                                       i=$(($i + 1))
+                                       i=$((i + 1))
                                        while [ ${#addr} -lt 4 ]; do
                                                addr="0${addr}"
                                        done
@@ -118,7 +118,7 @@ for d in $DOMAINS; do
                                        fi
                                done
                                while [ $i != 8 ]; do
-                               i=$(($i + 1))
+                               i=$((i + 1))
                                        front="$front byte:0 byte:0"
                                done
                                front="${front}$back"
@@ -151,7 +151,7 @@ else
 fi
 
 # Try to ensure that config dirs exist
-if type config_mkdirs >/dev/null 2>&1; then
+if command -v config_mkdirs >/dev/null 2>&1; then
        config_mkdirs "$dnsmasq_conf" "$dnsmasq_resolv"
 else
        @SBINDIR@/resolvconf -D "$dnsmasq_conf" "$dnsmasq_resolv"
diff -r b7ae6464da34 -r 21e3d2ebc894 external/bsd/openresolv/dist/libc.in
--- a/external/bsd/openresolv/dist/libc.in      Tue Jun 27 17:04:19 2023 +0000
+++ b/external/bsd/openresolv/dist/libc.in      Tue Jun 27 17:07:53 2023 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2007-2020 Roy Marples
+# Copyright (c) 2007-2023 Roy Marples
 # All rights reserved
 
 # libc subscriber for resolvconf
@@ -94,6 +94,7 @@ elif [ -d "$SYSCONFDIR"/resolvconf ]; th
        fi
 fi
 : ${resolv_conf:=/etc/resolv.conf}
+: ${resolv_conf_tmp:="$resolv_conf.$$.openresolv"}
 : ${libc_service:=nscd}
 : ${list_resolv:=@SBINDIR@/resolvconf -l}
 if [ "${resolv_conf_head-x}" = x ] && [ -f "$SYSCONFDIR"/resolv.conf.head ]
@@ -107,7 +108,7 @@ fi
 
 backup=true
 signature="# Generated by resolvconf"
- 
+
 uniqify()
 {
        result=
@@ -226,8 +227,26 @@ if $backup; then
        fi
 fi
 
-# Create our resolv.conf now
-(umask 022; printf %s "$newconf" >"$resolv_conf")
+# There are pros and cons for writing directly to resolv.conf
+# instead of a temporary file and then moving it over.
+# The default is to write to resolv.conf as it has the least
+# issues and has been the long standing default behaviour.
+case "${resolv_conf_mv:-NO}" in
+[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
+       # Protect against symlink attack, ensure new file does not exist
+       rm -f "$resolv_conf_tmp"
+       # Keep original file owner, group and mode
+       [ -r "$resolv_conf" ] && cp -p "$resolv_conf" "$resolv_conf_tmp"
+       # Create our resolv.conf now
+       if (umask 022; printf %s "$newconf" >"$resolv_conf_tmp"); then
+               mv "$resolv_conf_tmp" "$resolv_conf"
+       fi
+       ;;
+*)
+       (umask 022; printf %s "$newconf" >"$resolv_conf")
+       ;;
+esac
+
 if [ -n "$libc_restart" ]; then
        eval $libc_restart
 elif [ -n "$RESTARTCMD" ]; then
diff -r b7ae6464da34 -r 21e3d2ebc894 external/bsd/openresolv/dist/named.in
--- a/external/bsd/openresolv/dist/named.in     Tue Jun 27 17:04:19 2023 +0000
+++ b/external/bsd/openresolv/dist/named.in     Tue Jun 27 17:07:53 2023 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2007-2020 Roy Marples
+# Copyright (c) 2007-2023 Roy Marples
 # All rights reserved
 
 # named subscriber for resolvconf
@@ -79,7 +79,7 @@ for d in $DOMAINS; do
 done
 
 # Try to ensure that config dirs exist
-if type config_mkdirs >/dev/null 2>&1; then
+if command -v config_mkdirs >/dev/null 2>&1; then
        config_mkdirs "$named_options" "$named_zones"
 else
        @SBINDIR@/resolvconf -D "$named_options" "$named_zones"
diff -r b7ae6464da34 -r 21e3d2ebc894 external/bsd/openresolv/dist/pdnsd.in
--- a/external/bsd/openresolv/dist/pdnsd.in     Tue Jun 27 17:04:19 2023 +0000
+++ b/external/bsd/openresolv/dist/pdnsd.in     Tue Jun 27 17:07:53 2023 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2010-2020 Roy Marples
+# Copyright (c) 2010-2023 Roy Marples
 # All rights reserved
 
 # pdnsd subscriber for resolvconf
@@ -46,7 +46,7 @@ remove_markers()
        in_marker=0
 
        shift; shift
-       if type sed >/dev/null 2>&1; then
+       if command -v sed >/dev/null 2>&1; then
                sed "/^$m1/,/^$m2/d" $@
        else
                for x do
@@ -66,9 +66,9 @@ remove_markers()
 change_file()
 {
        if [ -e "$1" ]; then
-               if type cmp >/dev/null 2>&1; then
+               if command -v cmp >/dev/null 2>&1; then
                        cmp -s "$1" "$2"
-               elif type diff >/dev/null 2>&1; then
+               elif command -v diff >/dev/null 2>&1; then
                        diff -q "$1" "$2" >/dev/null
                else
                        # Hopefully we're only working on small text files ...
@@ -88,7 +88,7 @@ newresolv="# Generated by resolvconf$NL"
 changed=false
 
 # Try to ensure that config dirs exist
-if type config_mkdirs >/dev/null 2>&1; then
+if command -v config_mkdirs >/dev/null 2>&1; then
        config_mkdirs "$pdnsd_resolv" "$pdnsd_conf"
 else
        @SBINDIR@/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf"
diff -r b7ae6464da34 -r 21e3d2ebc894 external/bsd/openresolv/dist/resolvconf.8.in
--- a/external/bsd/openresolv/dist/resolvconf.8.in      Tue Jun 27 17:04:19 2023 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.8.in      Tue Jun 27 17:07:53 2023 +0000
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2007-2020 Roy Marples
+.\" Copyright (c) 2007-2023 Roy Marples
 .\" All rights reserved
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -189,7 +189,7 @@ Echo the resolvconf version to
 .El
 .Pp
 .Nm
-also has some commands designed to be used by it's subscribers and
+also has some commands designed to be used by its subscribers and
 system startup:-
 .Bl -tag -width pattern_opt
 .It Fl I
@@ -229,7 +229,7 @@ in the correct order.
 .Nm
 first processes interfaces from the
 .Sy interface_order
-list, then interfaces without a metic and that match the
+list, then interfaces without a metric and that match the
 .Sy dynamic_order
 list, then interfaces with a metric in order and finally the rest in
 the operating systems lexical order.
diff -r b7ae6464da34 -r 21e3d2ebc894 external/bsd/openresolv/dist/resolvconf.conf.5.in
--- a/external/bsd/openresolv/dist/resolvconf.conf.5.in Tue Jun 27 17:04:19 2023 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.conf.5.in Tue Jun 27 17:07:53 2023 +0000
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2009-2020 Roy Marples
+.\" Copyright (c) 2009-2023 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 1, 2020
+.Dd May 23, 2023
 .Dt RESOLVCONF.CONF 5
 .Os
 .Sh NAME
@@ -134,7 +134,7 @@ search foo.org dead.beef
 nameserver 1.2.3.4
 nameserver 2.3.4.5
 .Ed
-and this configuaration:
+and this configuration:
 .Bd -compact -literal -offset indent
 replace="search/foo*/bar.com"
 replace="$replace nameserver/1.2.3.4/5.6.7.8"
@@ -210,6 +210,12 @@ Prepend name servers to the dynamically 
 Append search domains to the dynamically generated list.
 .It Sy prepend_search
 Prepend search domains to the dynamically generated list.
+.It Sy resolv_conf_mv
+Defaults to NO.
+Defines if
+.Pa /etc/resolv.conf
+is updated by writing to a temporary file and then moving it
+vs writing directly to it.
 .El
 .Sh SUBSCRIBER OPTIONS
 openresolv ships with subscribers for the name servers
@@ -222,7 +228,7 @@ and
 Each subscriber can create configuration files which should be included in
 the subscribers main configuration file.
 .Pp
-To disable a subscriber, simply set it's name to NO.
+To disable a subscriber, simply set its name to NO.
 For example, to disable the libc subscriber you would set:
 .Bd -compact -literal -offset indent
 libc=NO
@@ -322,6 +328,9 @@ forward-zones-file=/etc/pdns/recursor-zo
 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.
+.It Sy unbound_forward_zone_options
+Options appended to each forward zone.
+Each option should be separated by an embedded new line.
 .Pp
 Example resolvconf.conf for unbound:
 .Bd -compact -literal -offset indent
@@ -385,4 +394,4 @@ Each distribution is a special snowflake
 differently, namely the named service script.
 .Pp
 Please report them to
-.Lk http://roy.marples.name/projects/openresolv
+.Lk https://roy.marples.name/projects/openresolv
diff -r b7ae6464da34 -r 21e3d2ebc894 external/bsd/openresolv/dist/resolvconf.in
--- a/external/bsd/openresolv/dist/resolvconf.in        Tue Jun 27 17:04:19 2023 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.in        Tue Jun 27 17:07:53 2023 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2007-2020 Roy Marples
+# Copyright (c) 2007-2023 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.12.0"
+OPENRESOLV_VERSION="3.13.2"
 SYSCONFDIR=@SYSCONFDIR@
 LIBEXECDIR=@LIBEXECDIR@
 VARDIR=@VARDIR@
@@ -158,7 +158,7 @@ private_iface()
        if [ -e "$PRIVATEDIR/$iface" ]; then
                return 0
        fi
-       
+
        for p in $private_interfaces; do
                case "$iface" in
                "$p"|"$p":*) return 0;;
@@ -290,9 +290,9 @@ config_mkdirs()
 
 # With the advent of alternative init systems, it's possible to have
 # more than one installed. So we need to try and guess what one we're
-# using unless overriden by configure.
+# using unless overridden by configure.
 # Note that restarting a service is a last resort - the subscribers
-# should make a reasonable attempt to reconfigre the service via some
+# should make a reasonable attempt to reconfigure the service via some
 # method, normally SIGHUP.
 detect_init()
 {
@@ -327,6 +327,12 @@ detect_init()
                   then
                        /usr/sbin/invoke-rc.d $1 restart
                   fi'
+       elif [ -x /usr/bin/s6-rc ] && [ -x /usr/bin/s6-svc ]; then
+               RESTARTCMD='
+                  if s6-rc -a list | grep -qFx $1-srv
+                  then
+                       s6-svc -r /run/service/$1-srv
+                  fi'
        elif [ -x /sbin/service ]; then
                # Old RedHat
                RCDIR=/etc/init.d
@@ -367,6 +373,8 @@ detect_init()
                        then
                                /etc/rc.d/$1 restart



Home | Main Index | Thread Index | Old Index