Skip to contentSkip to conversation

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

PATCH In review [email protected]... 3 participants 3 messages May 20, 2016 – May 30, 2016

lore
Share & tools
lore
#0 lore raw

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

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

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.

URL: https://github.com/OpenVPN/openvpn/pull/34

---
 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.5.5
#1 lore raw
Quoted 39 lines · On Fri, May 20, 2016 at 11:25 AM, <[email protected]...> wrote:

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

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.

URL: https://github.com/OpenVPN/openvpn/pull/34

---
 contrib/pull-resolv-conf/client.up | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
contrib/pull-resolv-conf/client.up +5 -4
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"

contrib/pull-resolv-conf/client.up while true; do · line 93

Quoted 10 lines
contrib/pull-resolv-conf/client.up +3 -1
+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

For the public archive: ACK.

-Steffan

#2 lore raw
In reply to [email protected]...

From: David Sommerseth <[email protected]...>

Your patch has been applied to the master branch.

commit 4a506b9ca2d8bbfaa5d49c6fe9a073d8ff3e59d1

Author: Jeffrey Cutter
Date:   Fri May 20 12:25:10 2016 +0300
     Update contrib/pull-resolv-conf/client.up for no DOMAIN

     URL: https://github.com/OpenVPN/openvpn/pull/34
     Acked-by: Steffan Karger <[email protected]...>
     Signed-off-by: Samuli Seppänen <[email protected]...>
     Acked-by: Steffan Karger <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/11682
     Signed-off-by: David Sommerseth <[email protected]...>

--
kind regards,

David Sommerseth