From owner-svn-src-stable@freebsd.org Mon Feb 20 03:26:21 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63413CE34EE; Mon, 20 Feb 2017 03:26:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B54717B4; Mon, 20 Feb 2017 03:26:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1K3QKDR052685; Mon, 20 Feb 2017 03:26:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1K3QJv1052675; Mon, 20 Feb 2017 03:26:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201702200326.v1K3QJv1052675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Feb 2017 03:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r313980 - in stable/11: contrib/openresolv sbin/resolvconf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Feb 2017 03:26:21 -0000 Author: pfg Date: Mon Feb 20 03:26:19 2017 New Revision: 313980 URL: https://svnweb.freebsd.org/changeset/base/313980 Log: MFC r312992: MFV r312970, 313160: openresolv: update to version 3.9.0. It is now possible to drop the _WITH_ARG vars thanks to a change to the pdns_recursor upstreamed by Guy Yur. Modified: stable/11/contrib/openresolv/Makefile stable/11/contrib/openresolv/configure stable/11/contrib/openresolv/libc.in stable/11/contrib/openresolv/pdns_recursor.in stable/11/contrib/openresolv/resolvconf.8.in stable/11/contrib/openresolv/resolvconf.conf.5.in stable/11/contrib/openresolv/resolvconf.in stable/11/sbin/resolvconf/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/openresolv/Makefile ============================================================================== --- stable/11/contrib/openresolv/Makefile Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/Makefile Mon Feb 20 03:26:19 2017 (r313980) @@ -37,6 +37,11 @@ SED_STATUSARG= -e 's:@STATUSARG@:${STAT DISTPREFIX?= ${PKG}-${VERSION} DISTFILEGZ?= ${DISTPREFIX}.tar.gz DISTFILE?= ${DISTPREFIX}.tar.xz +DISTINFO= ${DISTFILE}.distinfo +DISTINFOSIGN= ${DISTINFO}.asc +CKSUM?= cksum -a SHA256 +PGP?= netpgp + FOSSILID?= current .SUFFIXES: .in @@ -53,7 +58,7 @@ clean: rm -f ${TARGET} distclean: clean - rm -f config.mk ${DISTFILE} + rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} installdirs: @@ -83,3 +88,11 @@ dist: fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ} gunzip -c ${DISTFILEGZ} | xz >${DISTFILE} rm ${DISTFILEGZ} + +distinfo: dist + rm -f ${DISTINFO} ${DISTINFOSIGN} + ${CKSUM} ${DISTFILE} >${DISTINFO} + #printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO} + ${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO} + chmod 644 ${DISTINFOSIGN} + ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN} Modified: stable/11/contrib/openresolv/configure ============================================================================== --- stable/11/contrib/openresolv/configure Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/configure Mon Feb 20 03:26:19 2017 (r313980) @@ -120,14 +120,21 @@ echo "Configuring openresolv for ... $OS rm -rf $CONFIG_MK echo "# $OS" >$CONFIG_MK -# On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled -# regardless of if it's not running. -# So we force onestatus to work around this silly bug. -if [ -z "$STATUSARG" ]; then - case "$OS" in - freebsd*) STATUSARG="onestatus";; - esac -fi +case "$OS" in +freebsd*) + # On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled + # regardless of if it's not running. + # So we force onestatus to work around this silly bug. + if [ -z "$STATUSARG" ]; then + STATUSARG="onestatus" + fi + ;; +linux*) + # cksum does't support -a and netpgp is rare + echo "CKSUM= sha256sum --tag" >>$CONFIG_MK + echo "PGP= gpg2" >>$CONFIG_MK + ;; +esac for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR RESTARTCMD RCDIR STATUSARG do Modified: stable/11/contrib/openresolv/libc.in ============================================================================== --- stable/11/contrib/openresolv/libc.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/libc.in Mon Feb 20 03:26:19 2017 (r313980) @@ -216,7 +216,7 @@ fi 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" Modified: stable/11/contrib/openresolv/pdns_recursor.in ============================================================================== --- stable/11/contrib/openresolv/pdns_recursor.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/pdns_recursor.in Mon Feb 20 03:26:19 2017 (r313980) @@ -34,7 +34,6 @@ NL=" " : ${pdns_service:=pdns_recursor} -: ${pdns_restart:=@RESTARTCMD ${pdns_service}@} newzones= @@ -68,5 +67,12 @@ if [ ! -f "$pdns_zones" ] || \ [ "$(cat "$pdns_zones")" != "$(printf %s "$newzones")" ] then printf %s "$newzones" >"$pdns_zones" - eval $pdns_restart + if [ -n "$pdns_restart" ]; then + eval $pdns_restart + elif [ -n "$RESTARTCMD" ]; then + set -- ${pdns_service} + eval $RESTARTCMD + else + @SBINDIR@/resolvconf -r ${pdns_service} + fi fi Modified: stable/11/contrib/openresolv/resolvconf.8.in ============================================================================== --- stable/11/contrib/openresolv/resolvconf.8.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/resolvconf.8.in Mon Feb 20 03:26:19 2017 (r313980) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 7, 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 @@ -106,7 +108,7 @@ 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,7 +128,7 @@ on the .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 existent interfaces. Only really useful for deleting interfaces. @@ -146,7 +148,7 @@ as exclusive when adding, otherwise only .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 @@ 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. +.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 @@ Here are some suggested protocol tags to .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 Modified: stable/11/contrib/openresolv/resolvconf.conf.5.in ============================================================================== --- stable/11/contrib/openresolv/resolvconf.conf.5.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/resolvconf.conf.5.in Mon Feb 20 03:26:19 2017 (r313980) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 28, 2016 +.Dd December 29, 2016 .Dt RESOLVCONF.CONF 5 .Os .Sh NAME @@ -69,6 +69,11 @@ If unset, defaults to the following:- 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,6 +107,11 @@ Requires a local nameserver other than l 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: Modified: stable/11/contrib/openresolv/resolvconf.in ============================================================================== --- stable/11/contrib/openresolv/resolvconf.in Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/contrib/openresolv/resolvconf.in Mon Feb 20 03:26:19 2017 (r313980) @@ -25,13 +25,19 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. RESOLVCONF="$0" -OPENRESOLV_VERSION="3.8.1" +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,6 +96,7 @@ usage() that match the specified pattern -u Run updates from our current DNS information + --version Echo the ${RESOLVCONF##*/} version Options: -f Ignore non existent interfaces @@ -129,6 +136,34 @@ strip_trailing_dots() 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,20 +179,10 @@ parse_resolv() 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 ;; @@ -301,9 +326,9 @@ fi" /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 @@ -378,6 +403,14 @@ list_resolv() done fi excl=true + cd "$IFACEDIR" + for i in $inclusive_interfaces; do + if [ -f "$i" -a "$list" = "$i" ]; then + list= + excl=false + break + fi + done ;; *) excl=false @@ -418,7 +451,6 @@ list_resolv() cd "$IFACEDIR" retval=1 - excl=true for i in $(uniqify $list); do # Only list interfaces which we really have if ! [ -f "$i" ]; then @@ -432,8 +464,7 @@ list_resolv() if [ "$cmd" = i -o "$cmd" = "-i" ]; then printf %s "$i " else - echo_resolv "$i" - echo + echo_resolv "$i" && echo fi [ $? = 0 -a "$retval" = 1 ] && retval=0 done Modified: stable/11/sbin/resolvconf/Makefile ============================================================================== --- stable/11/sbin/resolvconf/Makefile Mon Feb 20 03:12:46 2017 (r313979) +++ stable/11/sbin/resolvconf/Makefile Mon Feb 20 03:26:19 2017 (r313980) @@ -20,9 +20,6 @@ SBINDIR= /sbin # We don't assume to restart the services in /sbin. So, though # our service(8) is in /usr/sbin, we can use it, here. -CMD1_WITH_ARG= \1 onestatus >/dev/null 2>\&1 -CMD2_WITH_ARG= \1 restart -RESTARTCMD_WITH_ARG= /usr/sbin/service ${CMD1_WITH_ARG} \&\& /usr/sbin/service ${CMD2_WITH_ARG} CMD1= \\$$1 onestatus >/dev/null 2>\&1 CMD2= \\$$1 restart RESTARTCMD= "/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}" @@ -32,7 +29,6 @@ ${f}: ${f}.in sed -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \ -e 's:@LIBEXECDIR@:${FILESDIR}:g' \ -e 's:@VARDIR@:${VARDIR}:g' \ - -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD_WITH_ARG}:g' \ -e 's:@RESTARTCMD@:${RESTARTCMD}:g' \ -e 's:@RCDIR@:${RCDIR}:g' \ -e 's:@SBINDIR@:${SBINDIR}:g' \