Skip to contentSkip to conversation

Update contrib/pull-resolv-conf/client.up for no DOMAIN

PATCH In review Jeffrey Cutter 2 participants 3 messages Oct 25, 2015 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 Update contrib/pull-resolv-conf/client.up for no DOMAIN

In reply to a message not in the archive

Author: Jeffrey Cutter <[email protected]...>

Update contrib/pull-resolv-conf/client.up for no DOMAIN

When no DOMAIN is received from push/pull, do not add either domain or search to the resolv.conf. Fix typo in comment resolv.con[f].
Only add new line when using domain or search.

--- contrib/pull-resolv-conf/client.up | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)

contrib/pull-resolv-conf/client.upindex b28d4d1..8858b47 100644--- a/contrib/pull-resolv-conf/client.up+++ b/contrib/pull-resolv-conf/client.up@@ -50,9 +50,10 @@ nl=' # or # "dhcp-option DNS 10.10.10.10" (multiple allowed) renamed from contrib/pull-resolv-conf/client.up +0 -0

-# each DNS option becomes a "nameserver" option in resolv.con+# each DNS option becomes a "nameserver" option in resolv.conf # if we get one DOMAIN, that becomes "domain" in resolv.conf # if we get multiple DOMAINS, those become "search" lines in resolv.conf+# if we get no DOMAINS, then don't use either domain or search. while true; do   eval fopt=\$foreign_option_${i}@@ -78,13 +79,15 @@ while true; do   i=$((i + 1)) done
-ds=domain-if [ $ndoms -gt 1 ]; then-  ds=search+ds=""+if [ $ndoms -eq 1 ]; then+  ds="${nl}domain"+elif [ $ndoms -gt 1 ]; then+  ds="${nl}search" fi
 # This is the complete file - "$domains" has a leading space already-out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${nl}${ds}${domains}"+out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${ds}${domains}"

 # use resolvconf if it's available if type resolvconf >/dev/null 2>&1; then--2.4.3
#2 lore raw

Hi,

contrib/pull-resolv-conf/client.upindex b28d4d1..8858b47 100644--- a/contrib/pull-resolv-conf/client.up+++ b/contrib/pull-resolv-conf/client.up@@ -50,9 +50,10 @@ nl=' # or # "dhcp-option DNS 10.10.10.10" (multiple allowed)

Quoted 11 lines · Jeffrey Cutter

Author: Jeffrey Cutter <[email protected]...>

Update contrib/pull-resolv-conf/client.up for no DOMAIN

When no DOMAIN is received from push/pull, do not add either domain or search to the resolv.conf. Fix typo in comment resolv.con[f].
Only add new line when using domain or search.

--- contrib/pull-resolv-conf/client.up | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)

contrib/pull-resolv-conf/client.upindex b28d4d1..8858b47 100644--- a/contrib/pull-resolv-conf/client.up+++ b/contrib/pull-resolv-conf/client.up@@ -50,9 +50,10 @@ nl=' # or # "dhcp-option DNS 10.10.10.10" (multiple allowed) renamed from contrib/pull-resolv-conf/client.up +0 -0

Uh. Whatever you used to generate this patch, it totally massacred it.

Can you please re-send using git-format-patch and *attach* the patch, or using get-send-email and send from there right away? Usually the latter is the one that generates the emails most easy to work with.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#3 lore raw

PATCH 1/1 Update contrib/pull-resolv-conf/client.up for no DOMAIN

Author: Jeffrey Cutter <[email protected]...>

Update contrib/pull-resolv-conf/client.up for no DOMAIN

When no DOMAIN is received from push/pull, do not add either domain or search to the resolv.conf. Fix typo in comment resolv.con[f].
Only add new line when using domain or search.

From 1199a8f6d6545eb3d9fa9d4f6ac72f692a5b735a Mon Sep 17 00:00:00 2001
From: Jeffrey Cutter <[email protected]>
Date: Sat, 12 Sep 2015 20:03:18 -0400
Subject: [PATCH] Update contrib/pull-resolv-conf/client.up for no DOMAIN When
no DOMAIN is received from push/pull, do not add either domain or search to the resolv.conf. Fix typo in comment resolv.con[f]. Only add new line when using domain or search.

---
 contrib/pull-resolv-conf/client.up | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
contrib/pull-resolv-conf/client.up +8 -5
index b28d4d1..8858b47 100644
@@ -50,9 +50,10 @@ nl='
 # or
 # "dhcp-option DNS 10.10.10.10" (multiple allowed)
 
-# each DNS option becomes a "nameserver" option in resolv.con
+# each DNS option becomes a "nameserver" option in resolv.conf
 # if we get one DOMAIN, that becomes "domain" in resolv.conf
 # if we get multiple DOMAINS, those become "search" lines in resolv.conf
+# if we get no DOMAINS, then don't use either domain or search.
 
 while true; do
   eval fopt=\$foreign_option_${i}
@@ -78,13 +79,15 @@ while true; do
   i=$((i + 1))
 done
 
-ds=domain
-if [ $ndoms -gt 1 ]; then
-  ds=search
+ds=""
+if [ $ndoms -eq 1 ]; then
+  ds="${nl}domain"
+elif [ $ndoms -gt 1 ]; then
+  ds="${nl}search"
 fi
 
 # This is the complete file - "$domains" has a leading space already
-out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${nl}${ds}${domains}"
+out="# resolv.conf autogenerated by ${0} (${1})${nl}${dns}${ds}${domains}"
 
 # use resolvconf if it's available
 if type resolvconf >/dev/null 2>&1; then
Signature · 1 line
2.4.3