aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Duran <jlduran@FreeBSD.org>2025-11-19 01:09:58 +0000
committerJose Luis Duran <jlduran@FreeBSD.org>2025-11-19 01:09:58 +0000
commit0628400590e025b7db1c0905e6ee488a24ef3f60 (patch)
tree93fb7d261eb522424e9f3c7d105632a66bf1a4b6
parent4640f5008922c5b189d2f7b63edf73300277e6df (diff)
local-unbound: Read a tab separated resolv.conf
Use [[:space:]] rather than a white space character to delimit the keys and the values in the resolv.conf file. PR: 236079 Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53811
-rwxr-xr-xusr.sbin/unbound/setup/local-unbound-setup.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/unbound/setup/local-unbound-setup.sh b/usr.sbin/unbound/setup/local-unbound-setup.sh
index 25cfef48b6f0..ec3aeb673ecc 100755
--- a/usr.sbin/unbound/setup/local-unbound-setup.sh
+++ b/usr.sbin/unbound/setup/local-unbound-setup.sh
@@ -118,8 +118,8 @@ set_chrootdir() {
get_nameservers() {
while read line ; do
local bareline=${line%%\#*}
- local key=${bareline%% *}
- local value=${bareline#* }
+ local key=${bareline%%[[:space:]]*}
+ local value=${bareline#*[[:space:]]}
case ${key} in
nameserver)
case ${value} in
@@ -145,8 +145,8 @@ gen_resolv_conf() {
local edns0=no
while read line ; do
local bareline=${line%%\#*}
- local key=${bareline%% *}
- local value=${bareline#* }
+ local key=${bareline%%[[:space:]]*}
+ local value=${bareline#*[[:space:]]}
case ${key} in
nameserver)
case ${value} in