Skip to content

Commit

Permalink
resolve: add option to specify resolvconf search domain
Browse files Browse the repository at this point in the history
  • Loading branch information
corngood committed May 9, 2023
1 parent c0ae81f commit 9d5f9ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libcharon/plugins/resolve/resolve_handler.c
Expand Up @@ -59,6 +59,8 @@ struct private_resolve_handler_t {
*/
char *iface;

char *search_domain;

/**
* Mutex to access file exclusively
*/
Expand Down Expand Up @@ -206,6 +208,8 @@ static bool invoke_resolvconf(private_resolve_handler_t *this, array_t *servers)
shell = fdopen(in, "w");
if (shell)
{
if (this->search_domain)
fprintf(shell, "search %s\n", this->search_domain);
for (i = 0; i < array_count(servers); i++)
{
array_get(servers, i, &dns);
Expand Down Expand Up @@ -498,6 +502,9 @@ resolve_handler_t *resolve_handler_create()
if (!this->resolvconf && stat(RESOLVCONF_EXEC, &st) == 0)
{
this->resolvconf = RESOLVCONF_EXEC;
this->search_domain = lib->settings->get_str(lib->settings,
"%s.plugins.resolve.resolvconf.search_domain",
NULL, lib->ns);
}

if (this->resolvconf)
Expand Down

0 comments on commit 9d5f9ac

Please sign in to comment.