Re: git: b5fb1f44ed43 - main - Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf

From: Dag-Erling_Smørgrav <des_at_FreeBSD.org>
Date: Wed, 15 May 2024 10:04:16 UTC
Dag-Erling Smørgrav <des@FreeBSD.org> writes:
> The branch main has been updated by des:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=b5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125
>
> commit b5fb1f44ed435fa25fe3de87c9b9ee6c0aad5125
> Author:     Willem Toorop <willem@nlnetlabs.nl>
> AuthorDate: 2024-05-07 12:43:16 +0000
> Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
> CommitDate: 2024-05-15 09:52:49 +0000
>
>     Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf
>     
>     This /etc/resolv.conf:
>         # x
>     
>         # nameserver 8.8.8.8
>     
>     Still configured 8.8.8.8 as nameserver, because the comment detection in `ldns_resolver_new_frm_fp_l()` didn't anticipate empty lines before the comment.
>     This fix removed all comment handling from `ldns_resolver_new_frm_fp_l()`. Instead a new function is introduced `ldns_fget_token_l_resolv_conf()` that skips comments that start with '#' and ';'. The old `ldns_fget_token_l()` (that is used for zonefiles too) still accepts only ';' for comments.
> ---
>  contrib/ldns/parse.c    | 35 +++++++++++++++++++++++++++----
>  contrib/ldns/resolver.c | 55 ++++++++++---------------------------------------
>  2 files changed, 42 insertions(+), 48 deletions(-)

I actually did this as a subtree merge:

% git subtree merge --prefix=contrib/ldns vendor/ldns
Merge made by the 'ort' strategy.
 contrib/ldns/parse.c    | 35 +++++++++++++++++++++++++++----
 contrib/ldns/resolver.c | 55 ++++++++++---------------------------------------
 2 files changed, 42 insertions(+), 48 deletions(-)
% git show
% git commit --amend
[main 2dbd65dc861c] ldns: Ignore commented-out lines in resolv.conf.
 Date: Wed May 15 11:50:11 2024 +0200
% git commit --amend                               
[main bee1ed74ab26] ldns: Ignore commented-out lines in resolv.conf.
 Date: Wed May 15 11:50:11 2024 +0200

However, I had to rebase before pushing and that appears to have dropped
the merge commit, and I didn't notice until after I'd pushed.

% git reflog
b5fb1f44ed43 (HEAD -> main, freebsd/main, freebsd/HEAD) HEAD@{0}: pull --rebase (finish): returning to refs/heads/main
b5fb1f44ed43 (HEAD -> main, freebsd/main, freebsd/HEAD) HEAD@{1}: pull --rebase (pick): Issue #237 : Resolver uses nameserver commented out in /etc/resolv.conf
61dece6d27fb (github/main) HEAD@{2}: pull --rebase (start): checkout 61dece6d27fb2436928ca93d65667b358e05aa7b
bee1ed74ab26 HEAD@{3}: commit (amend): ldns: Ignore commented-out lines in resolv.conf.
2dbd65dc861c HEAD@{4}: commit (amend): ldns: Ignore commented-out lines in resolv.conf.
74ce793d921d HEAD@{5}: merge 0c57cb21e0c6a8a86fa074baeaeb6a002e2b7734: Merge made by the 'ort' strategy.
61dece6d27fb (github/main) HEAD@{6}: pull --rebase: Fast-forward

DES
-- 
Dag-Erling Smørgrav - des@FreeBSD.org