Bug 220610 - Expose _PATH_RESCONF as __res_conf_name for improved determinism of lib/libc/resolv
Summary: Expose _PATH_RESCONF as __res_conf_name for improved determinism of lib/libc/...
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Dag-Erling Smørgrav
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-10 19:31 UTC by Enji Cooper
Modified: 2026-07-18 08:24 UTC (History)
1 user (show)

See Also:
linimon: mfc-stable15?
linimon: mfc-stable14?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2017-07-10 19:31:51 UTC
Porting from Isilon internal bugzilla/assigning to me:

"""
I refactored the tests to try and make them more usable, but the problem is that
there are a number of factors on the system (and outside of it) that made things
worse.

libc's resolv functionality (and our modifications) need to be refactored in such
a way that it's possible for us to do unittesting to the function calls to ensure
that they're doing the right thing instead of writing (what is in effect) a
system level test in ATF/kyua (which is non-trivial/an improper use of the test
infrastructure).

I will look at implementing some of the hooks that NetBSD's testcases expect
when testing out their resolv functionality, e.g.

contrib/netbsd-tests/lib/libc/net/h_hostent.c:50 extern const char *__res_conf_name;
"""
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2017-07-10 19:32:30 UTC
(Sidenote: my approach taken will probably deserve a security audit)
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-01-08 04:14:36 UTC
For the following conditions
Product: Base System, Documentation Status: New, Open, In Progress, UNCONFIRMED 
Assignee: Former FreeBSD committer 

Reset to default assignee. Reset status to "Open".
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-06-29 15:53:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=702c24ccc0c208e9bc697e775abe47ff723e3012

commit 702c24ccc0c208e9bc697e775abe47ff723e3012
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-06-28 09:37:40 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-06-29 13:49:20 +0000

    libc/resolv: Export __res_conf_name

    Add a new global variable, __res_conf_name, which is initialized to
    _PATH_RESCONF and used in its place by res_init().  This allows test
    programs (and applications) to select a different configuration file
    to read instead of /etc/resolv.conf.

    PR:             220610

 lib/libc/resolv/Symbol.map | 4 ++++
 lib/libc/resolv/res_init.c | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)