Bug 236079 - local-unbound-setup cannot read resolv.conf with tabs as a separator
Summary: local-unbound-setup cannot read resolv.conf with tabs as a separator
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Jose Luis Duran
URL: https://reviews.freebsd.org/D53811
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-27 11:15 UTC by Miroslav Lachman
Modified: 2025-11-26 15:37 UTC (History)
2 users (show)

See Also:
jlduran: mfc-stable15+
jlduran: mfc-stable14+
jlduran: mfc-stable13+


Attachments
replace tabs by space (322 bytes, patch)
2019-02-27 11:15 UTC, Miroslav Lachman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miroslav Lachman 2019-02-27 11:15:39 UTC
Created attachment 202406 [details]
replace tabs by space

In resolv.conf keyword "nameserver" and its value (IP address) can be separated by spaces or tabs but local-unbound-setup accepts only spaces resulting in:

No forwarders found in resolv.conf, using existing forward.conf.

I am not so good in shellscripting so I fixed it by this line

local line=$(echo $line | sed -E 's/	/ /g')

I don't know how to write it as parameter expansion instead of calling sed in a subshell.
Comment 1 commit-hook freebsd_committer freebsd_triage 2025-11-19 01:12:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0628400590e025b7db1c0905e6ee488a24ef3f60

commit 0628400590e025b7db1c0905e6ee488a24ef3f60
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-11-19 01:09:58 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-11-19 01:09:58 +0000

    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

 usr.sbin/unbound/setup/local-unbound-setup.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-11-26 15:36:11 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5f2dd3dfd72da7b49d1f9a7f889437480aa6f19e

commit 5f2dd3dfd72da7b49d1f9a7f889437480aa6f19e
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-11-19 01:09:58 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-11-26 15:33:29 +0000

    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

    (cherry picked from commit 0628400590e025b7db1c0905e6ee488a24ef3f60)

 usr.sbin/unbound/setup/local-unbound-setup.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-11-26 15:36:12 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5a2f81012ab56436813a6c86fb578cc3a686f078

commit 5a2f81012ab56436813a6c86fb578cc3a686f078
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-11-19 01:09:58 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-11-26 15:34:40 +0000

    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

    (cherry picked from commit 0628400590e025b7db1c0905e6ee488a24ef3f60)

 usr.sbin/unbound/setup/local-unbound-setup.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-11-26 15:36:13 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=111b60a2fddca6051c6e782c4a9a4da258ed4cdf

commit 111b60a2fddca6051c6e782c4a9a4da258ed4cdf
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2025-11-19 01:09:58 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2025-11-26 15:34:23 +0000

    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

    (cherry picked from commit 0628400590e025b7db1c0905e6ee488a24ef3f60)

 usr.sbin/unbound/setup/local-unbound-setup.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Comment 5 Jose Luis Duran freebsd_committer freebsd_triage 2025-11-26 15:37:25 UTC
Thank you for the bug report!