-V is the same as -v but only echo's information set in resolvconf.conf
authorRoy Marples <roy@marples.name>
Mon, 20 Oct 2014 00:02:15 +0000 (00:02 +0000)
committerRoy Marples <roy@marples.name>
Mon, 20 Oct 2014 00:02:15 +0000 (00:02 +0000)
(ie, discards dynamically learned interfaces)
resolv_conf_passthrough can now be set to /dev/null or NULL which
will now use the -V option instead of the -v option to resolvconf.

libc.in
resolvconf.8.in
resolvconf.conf.5.in
resolvconf.in

diff --git a/libc.in b/libc.in
index a657f8658b628edcc7fd787aa74a5eb99c27fa7e..c951285a42acd4e9467a8355fff4e3f9b4ff1c85 100644 (file)
--- a/libc.in
+++ b/libc.in
@@ -130,8 +130,17 @@ case "${resolv_conf_passthrough:-NO}" in
        [ -z "$newest" ] && exit 0
        newconf="$(cat "$newest")$NL"
        ;;
        [ -z "$newest" ] && exit 0
        newconf="$(cat "$newest")$NL"
        ;;
+/dev/null|[Nn][Uu][Ll][Ll])
+       [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -V)"
+       ;;
+
 *)
        [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)"
 *)
        [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)"
+       ;;
+esac
+case "${resolv_conf_passthrough:-NO}" in
+[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) ;;
+*)
        newsearch="$(uniqify $prepend_search $SEARCH)"
        NS="$LOCALNAMESERVERS $NAMESERVERS"
        newns=
        newsearch="$(uniqify $prepend_search $SEARCH)"
        NS="$LOCALNAMESERVERS $NAMESERVERS"
        newns=
index 593306201de97b90d566ae85d552ec94f3bd4156..cf7000fee392e67f7efc50ced8a26e94a0dbe900 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd October 19, 2014
+.Dd October 20, 2014
 .Dt RESOLVCONF 8 SMM
 .Os
 .Sh NAME
 .Dt RESOLVCONF 8 SMM
 .Os
 .Sh NAME
@@ -168,6 +168,12 @@ also has some options designed to be used by its subscribers:-
 .It Fl v
 Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can
 configure the resolver easily.
 .It Fl v
 Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can
 configure the resolver easily.
+.It Fl V
+Same as
+.Fl v
+except that only the information configured in
+.Xr resolvconf.conf 5
+is set.
 .El
 .Sh INTERFACE ORDERING
 For
 .El
 .Sh INTERFACE ORDERING
 For
index 78a987d57f56510d5b52ebbcb6c83e61b8bc2b9a..ec0a0f9326bcb46b723577e456d041deba0c1d00 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd October 19, 2014
+.Dd October 20, 2014
 .Dt RESOLVCONF.CONF 5 SMM
 .Os
 .Sh NAME
 .Dt RESOLVCONF.CONF 5 SMM
 .Os
 .Sh NAME
@@ -114,6 +114,10 @@ A list of libc resolver options, as specified in
 When set to YES the latest resolv.conf is written to
 .Sy resolv_conf
 without any alteration.
 When set to YES the latest resolv.conf is written to
 .Sy resolv_conf
 without any alteration.
+When set to /dev/null or NULL only the information set in
+.Nm
+is written to
+.Sy resolv_conf .
 .It Sy resolv_conf_sortlist
 A libc resolver sortlist, as specified in
 .Xr resolv.conf 5 .
 .It Sy resolv_conf_sortlist
 A libc resolver sortlist, as specified in
 .Xr resolv.conf 5 .
index b3f31121d3255052bbe9f814993573563d4f54a2..a7c8d3c90cb735f0ccf9c98ca2800900ade3f7e4 100644 (file)
@@ -366,7 +366,9 @@ make_vars()
        if [ -n "$name_servers" -o -n "$search_domains" ]; then
                eval "$(echo_prepend | parse_resolv)"
        fi
        if [ -n "$name_servers" -o -n "$search_domains" ]; then
                eval "$(echo_prepend | parse_resolv)"
        fi
-       eval "$(list_resolv -l "$@" | parse_resolv)"
+       if [ -z "$VFLAG" ]; then
+               eval "$(list_resolv -l "$@" | parse_resolv)"
+       fi
        if [ -n "$name_servers_append" -o -n "$search_domains_append" ]; then
                eval "$(echo_append | parse_resolv)"
        fi
        if [ -n "$name_servers_append" -o -n "$search_domains_append" ]; then
                eval "$(echo_append | parse_resolv)"
        fi
@@ -413,12 +415,14 @@ make_vars()
 }
 
 force=false
 }
 
 force=false
-while getopts a:Dd:fhIilm:puv OPT; do
+VFLAG=
+while getopts a:Dd:fhIilm:puvV OPT; do
        case "$OPT" in
        f) force=true;;
        h) usage;;
        m) IF_METRIC="$OPTARG";;
        p) IF_PRIVATE=1;;
        case "$OPT" in
        f) force=true;;
        h) usage;;
        m) IF_METRIC="$OPTARG";;
        p) IF_PRIVATE=1;;
+       V) VFLAG=1;;
        '?') ;;
        *) cmd="$OPT"; iface="$OPTARG";;
        esac
        '?') ;;
        *) cmd="$OPT"; iface="$OPTARG";;
        esac
@@ -447,7 +451,7 @@ if [ "$cmd" = l -o "$cmd" = i ]; then
 fi
 
 # Not normally needed, but subscribers should be able to run independently
 fi
 
 # Not normally needed, but subscribers should be able to run independently
-if [ "$cmd" = v ]; then
+if [ "$cmd" = v -o -n "$VFLAG" ]; then
        make_vars "$iface"
        exit $?
 fi
        make_vars "$iface"
        exit $?
 fi