Date: Mon, 29 Feb 2016 14:46:39 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296190 - head/contrib/openresolv Message-ID: <201602291446.u1TEkdL9079747@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Mon Feb 29 14:46:39 2016 New Revision: 296190 URL: https://svnweb.freebsd.org/changeset/base/296190 Log: MFV r296164: Update openresolve to version 3.7.3 including: * Save the initial working directory and change to it just before running any scripts. This avoids scripts putting files accidently where they shouldn't. * Strip trailing dot from search and domain names. * man page improvements. Relnotes: yes Modified: head/contrib/openresolv/Makefile head/contrib/openresolv/resolvconf.conf.5.in head/contrib/openresolv/resolvconf.in Directory Properties: head/contrib/openresolv/ (props changed) Modified: head/contrib/openresolv/Makefile ============================================================================== --- head/contrib/openresolv/Makefile Mon Feb 29 09:22:39 2016 (r296189) +++ head/contrib/openresolv/Makefile Mon Feb 29 14:46:39 2016 (r296190) @@ -1,5 +1,5 @@ PKG= openresolv -VERSION= 3.7.1 +VERSION= 3.7.3 # Nasty hack so that make clean works without configure being run _CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk Modified: head/contrib/openresolv/resolvconf.conf.5.in ============================================================================== --- head/contrib/openresolv/resolvconf.conf.5.in Mon Feb 29 09:22:39 2016 (r296189) +++ head/contrib/openresolv/resolvconf.conf.5.in Mon Feb 29 14:46:39 2016 (r296190) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009-2015 Roy Marples +.\" Copyright (c) 2009-2016 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 May 14, 2015 +.Dd February 21, 2016 .Dt RESOLVCONF.CONF 5 .Os .Sh NAME @@ -42,8 +42,11 @@ must contain valid shell commands. Listed below are the standard .Nm variables that may be set. -If the values contain white space for special shell characters, +If the values contain whitespace, wildcards or other special shell characters, ensure they are quoted and escaped correctly. +See the +.Sy replace +variable for an example on quoting. .Pp After updating this file, you may wish to run .Nm resolvconf -u Modified: head/contrib/openresolv/resolvconf.in ============================================================================== --- head/contrib/openresolv/resolvconf.in Mon Feb 29 09:22:39 2016 (r296189) +++ head/contrib/openresolv/resolvconf.in Mon Feb 29 14:46:39 2016 (r296190) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2015 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ METRICDIR="$VARDIR/metrics" PRIVATEDIR="$VARDIR/private" EXCLUSIVEDIR="$VARDIR/exclusive" LOCKDIR="$VARDIR/lock" +_PWD="$PWD" warn() { @@ -119,6 +120,21 @@ echo_resolv() IFS="$OIFS" } +# Strip any trailing dot from each name as a FQDN does not belong +# in resolv.conf(5) +# 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() +{ + local n= + + for n; do + printf "%s" "${n%.}" + done + printf "\n" +} + # Parse resolv.conf's and make variables # for domain name servers, search name servers and global nameservers parse_resolv() @@ -162,14 +178,14 @@ parse_resolv() $islocal || ns="$ns${line#* } " ;; "domain "*) + search="$(strip_trailing_dots ${line#* })" if [ -z "$domain" ]; then - domain="${line#* }" + domain="$search" echo "DOMAIN=\"$domain\"" fi - search="${line#* }" ;; "search "*) - search="${line#* }" + search="$(strip_trailing_dots ${line#* })" ;; *) [ -n "$line" ] && continue @@ -752,6 +768,10 @@ eval "$(make_vars)" export RESOLVCONF DOMAINS SEARCH NAMESERVERS LOCALNAMESERVERS : ${list_resolv:=list_resolv -l} retval=0 + +# Run scripts in the same directory resolvconf is run from +# in case any scripts accidently dump files in the wrong place. +cd "$_PWD" for script in "$LIBEXECDIR"/*; do if [ -f "$script" ]; then eval script_enabled="\$${script##*/}"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602291446.u1TEkdL9079747>