Module Name: src Committed By: roy Date: Wed Jul 17 18:31:43 UTC 2019
Modified Files: src/external/bsd/openresolv/dist: Makefile libc.in pdnsd.in resolvconf.in Removed Files: src/external/bsd/openresolv/dist: README Log Message: Sync To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/openresolv/dist/Makefile cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/openresolv/dist/README cvs rdiff -u -r1.3 -r1.4 src/external/bsd/openresolv/dist/libc.in cvs rdiff -u -r1.2 -r1.3 src/external/bsd/openresolv/dist/pdnsd.in cvs rdiff -u -r1.4 -r1.5 src/external/bsd/openresolv/dist/resolvconf.in 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/Makefile diff -u src/external/bsd/openresolv/dist/Makefile:1.1.1.1 src/external/bsd/openresolv/dist/Makefile:1.2 --- src/external/bsd/openresolv/dist/Makefile:1.1.1.1 Wed Jul 17 18:24:23 2019 +++ src/external/bsd/openresolv/dist/Makefile Wed Jul 17 18:31:43 2019 @@ -79,11 +79,6 @@ maninstall: install: proginstall maninstall -import: - rm -rf /tmp/${DISTPREFIX} - ${INSTALL} -d /tmp/${DISTPREFIX} - cp README ${SRCS} /tmp/${DISTPREFIX} - dist-git: git archive --prefix=${DISTPREFIX}/ ${GITREF} | xz >${DISTFILE} @@ -103,3 +98,8 @@ 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 Index: src/external/bsd/openresolv/dist/libc.in diff -u src/external/bsd/openresolv/dist/libc.in:1.3 src/external/bsd/openresolv/dist/libc.in:1.4 --- src/external/bsd/openresolv/dist/libc.in:1.3 Tue Oct 9 01:28:35 2018 +++ src/external/bsd/openresolv/dist/libc.in Wed Jul 17 18:31:43 2019 @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2016 Roy Marples +# Copyright (c) 2007-2019 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() { - local key="$1" x= line= - + key="$1" shift + if [ $# -eq 0 ]; then while read -r line; do case "$line" in @@ -58,8 +58,6 @@ key_get_value() keys_remove() { - local key x line found - while read -r line; do found=false for key do @@ -79,7 +77,7 @@ local_nameservers="127.* 0.0.0.0 255.255 if [ -f "$SYSCONFDIR"/resolvconf.conf ]; then . "$SYSCONFDIR"/resolvconf.conf elif [ -d "$SYSCONFDIR"/resolvconf ]; then - SYSCONFDIR="$SYSCONFDIR/resolvconf/resolv.conf.d" + SYSCONFDIR="$SYSCONFDIR/resolvconf" base="$SYSCONFDIR/resolv.conf.d/base" if [ -f "$base" ]; then prepend_nameservers="$(key_get_value "nameserver " "$base")" @@ -112,7 +110,7 @@ signature="# Generated by resolvconf" uniqify() { - local result= + result= while [ -n "$1" ]; do case " $result " in *" $1 "*);; Index: src/external/bsd/openresolv/dist/pdnsd.in diff -u src/external/bsd/openresolv/dist/pdnsd.in:1.2 src/external/bsd/openresolv/dist/pdnsd.in:1.3 --- src/external/bsd/openresolv/dist/pdnsd.in:1.2 Mon Sep 24 21:58:11 2018 +++ src/external/bsd/openresolv/dist/pdnsd.in Wed Jul 17 18:31:43 2019 @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2010-2013 Roy Marples +# Copyright (c) 2010-2018 Roy Marples # All rights reserved # pdnsd subscriber for resolvconf @@ -41,14 +41,16 @@ signature_end="# End of resolvconf" # but sed may not always be available at the time. remove_markers() { - local m1="$1" m2="$2" x= line= in_marker=0 + m1="$1" + m2="$2" + in_marker=0 shift; shift if type sed >/dev/null 2>&1; then sed "/^$m1/,/^$m2/d" $@ else - for x; do - while read -r line; do + for x do + while read line; do case "$line" in "$m1"*) in_marker=1;; "$m2"*) in_marker=0;; Index: src/external/bsd/openresolv/dist/resolvconf.in diff -u src/external/bsd/openresolv/dist/resolvconf.in:1.4 src/external/bsd/openresolv/dist/resolvconf.in:1.5 --- src/external/bsd/openresolv/dist/resolvconf.in:1.4 Mon Oct 8 14:09:38 2018 +++ src/external/bsd/openresolv/dist/resolvconf.in Wed Jul 17 18:31:43 2019 @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2016 Roy Marples +# Copyright (c) 2007-2019 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.0" +OPENRESOLV_VERSION="3.9.1" SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ @@ -125,21 +125,22 @@ 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. -strip_trailing_dots() +# Also strip any comments denoted by #. +resolv_strip() { - local n= d= - - for n; do - printf "$d%s" "${n%.}" - d=" " + space= + for word; do + case "$word" in + \#*) break;; + esac + printf "%s%s" "$space${word%.}" + space=" " done printf "\n" } private_iface() { - local p - # Allow expansion cd "$IFACEDIR" @@ -168,12 +169,15 @@ private_iface() # for domain name servers, search name servers and global nameservers parse_resolv() { - local line= ns= ds= search= d= n= newns= - local new=true iface= private=false p= domain= l= islocal= - + domain= + new=true newns= + ns= + private=false + search= while read -r line; do + stripped_line="$(resolv_strip ${line#* })" case "$line" in "# resolv.conf from "*) if ${new}; then @@ -189,25 +193,28 @@ parse_resolv() "nameserver "*) islocal=false for l in $local_nameservers; do - case "${line#* }" in + case "$stripped_line" in $l) islocal=true - echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS ${line#* }\"" break ;; esac done - $islocal || ns="$ns${line#* } " + if $islocal; then + echo "LOCALNAMESERVERS=\"\$LOCALNAMESERVERS $stripped_line\"" + else + ns="$ns$stripped_line " + fi ;; "domain "*) - search="$(strip_trailing_dots ${line#* })" + search="$stripped_line" if [ -z "$domain" ]; then domain="$search" echo "DOMAIN=\"$domain\"" fi ;; "search "*) - search="$(strip_trailing_dots ${line#* })" + search="$stripped_line" ;; *) [ -n "$line" ] && continue @@ -236,7 +243,7 @@ parse_resolv() uniqify() { - local result= + result= while [ -n "$1" ]; do case " $result " in *" $1 "*);; @@ -249,8 +256,8 @@ uniqify() dirname() { - local dir= OIFS="$IFS" - local IFS=/ + OIFS="$IFS" + IFS=/ set -- $@ IFS="$OIFS" if [ -n "$1" ]; then @@ -267,7 +274,7 @@ dirname() config_mkdirs() { - local e=0 f d + e=0 for f; do [ -n "$f" ] || continue d="$(dirname "$f")" @@ -295,7 +302,7 @@ 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. - local status="@STATUSARG@" + status="@STATUSARG@" : ${status:=status} if [ -x /bin/systemctl ] && [ -S /run/systemd/private ]; then RESTARTCMD=' @@ -309,8 +316,9 @@ detect_init() then /usr/bin/systemctl restart $1.service fi' - elif [ -x /sbin/rc-service ] && [ -s /libexec/rc/init.d/softlevel ] || - [ -s /run/openrc/softlevel ] + elif [ -x /sbin/rc-service ] && + { [ -s /libexec/rc/init.d/softlevel ] || + [ -s /run/openrc/softlevel ]; } then RESTARTCMD='/sbin/rc-service -i $1 -- -Ds restart' elif [ -x /usr/sbin/invoke-rc.d ]; then @@ -385,7 +393,7 @@ detect_init() echo_resolv() { - local line= OIFS="$IFS" + OIFS="$IFS" [ -n "$1" ] && [ -f "$IFACEDIR/$1" ] || return 1 echo "# resolv.conf from $1" @@ -407,11 +415,16 @@ list_resolv() { [ -d "$IFACEDIR" ] || return 0 - local report=false list= retval=0 cmd="$1" excl= + cmd="$1" shift + excl=false + list= + report=false + retval=0 case "$IF_EXCLUSIVE" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) + excl=true if [ -d "$EXCLUSIVEDIR" ]; then cd "$EXCLUSIVEDIR" for i in *; do @@ -421,7 +434,6 @@ list_resolv() fi done fi - excl=true cd "$IFACEDIR" for i in $inclusive_interfaces; do if [ -f "$i" ] && [ "$list" = "$i" ]; then @@ -431,9 +443,6 @@ list_resolv() fi done ;; - *) - excl=false - ;; esac # If we have an interface ordering list, then use that. @@ -460,13 +469,18 @@ list_resolv() fi done done + # Interfaces have an implicit metric of 0 if not specified. + for i in *; do + if [ -f "$i" ] && ! [ -e "$METRICDIR/"*" $i" ]; then + list="$list $i" + fi + done if [ -d "$METRICDIR" ]; then cd "$METRICDIR" for i in *; do [ -f "$i" ] && list="$list ${i#* }" done fi - list="$list *" fi cd "$IFACEDIR" @@ -492,12 +506,13 @@ list_resolv() return $retval } -list_remove() { - local list= e= l= result= found= retval=0 - +list_remove() +{ [ -z "$2" ] && return 0 eval list=\"\$$1\" shift + result= + retval=0 set -f for e; do @@ -545,8 +560,6 @@ echo_append() replace() { - local r= k= f= v= val= sub= - while read -r keyword value; do for r in $replace; do k="${r%%/*}" @@ -586,8 +599,6 @@ replace() make_vars() { - local newdomains= d= dn= newns= ns= - # Clear variables DOMAIN= DOMAINS= @@ -608,6 +619,7 @@ make_vars() fi # Ensure that we only list each domain once + newdomains= for d in $DOMAINS; do dn="${d%%:*}" list_remove domain_blacklist "$dn" >/dev/null || continue @@ -699,7 +711,8 @@ if [ "$cmd" = r ] || [ "$cmd" = R ]; the set -- $args eval "$RESTARTCMD" else - echo "$RESTARTCMD" + echo "$RESTARTCMD" | + sed -e '/^$/d' -e 's/^ //g' fi exit $? fi