This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] resolv/resolv.h: allow alternative resolv.conf files
- From: Florian Weimer <fweimer at redhat dot com>
- To: Renzo Davoli <renzo at cs dot unibo dot it>, libc-alpha at sourceware dot org
- Date: Thu, 17 Aug 2017 14:41:00 +0200
- Subject: Re: [PATCH] resolv/resolv.h: allow alternative resolv.conf files
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 62C58D780F
- References: <20170817115013.sepjn4aqfi3dlwje@cs.unibo.it>
On 08/17/2017 01:50 PM, Renzo Davoli wrote:
> In network namespaces (like vdens https://github.com/rd235/vdens) it is sometimes necessary to
> define per-namespace resolver configurations.
>
> The simple patch here attached permits the definition of an environment variabile to define the
> path of the file to use instead of /etc/resolv.conf.
_PATH_RESCONF really has to be a string literal, and you can't use a GNU
C extension in such a way in an installed header file.
The environment variable would have to be ignored in AT_SECURE mode, so
you have to use __libc_secure_getenv or put it into unsecvars.h.
I'm still not convinced that this is the right thing to do. Can you
share more about your use case? I would expect that containers already
provide sufficient flexibility to adjust what is in /etc/resolv.conf.
Thanks,
Florian