This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Custom resolv.conf


Hi,

On Wed, Sep 15, 2004 at 01:29:56PM +0200, Michal Svec wrote:
> The attached patch adds a possibility to define a custom resolv.conf with 
> a shell variable (RESOLV_CONF, pretty similar to RESOLV_HOST_CONF).
> 
> Regards
> Michal
> --
> Michal Svec
> msvec@suse.cz

> --- glibc-2.3/resolv/res_init.c.orig	2004-08-18 13:33:37.000000000 +0200
> +++ glibc-2.3/resolv/res_init.c	2004-09-10 13:21:46.000000000 +0200
> @@ -88,6 +88,8 @@
>  
>  #include <not-cancel.h>
>  
> +#define ENV_RESOLVCONF	"RESOLV_CONF"
> +
>  /* Options.  Should all be left alone. */
>  #define RESOLVSORT
>  #define RFC1535
> @@ -149,6 +151,7 @@
>  int
>  __res_vinit(res_state statp, int preinit) {
>  	register FILE *fp;
> +	const char *rconf_name;
>  	register char *cp, **pp;
>  	register int n;
>  	char buf[BUFSIZ];
> @@ -240,7 +243,11 @@
>  	(line[sizeof(name) - 1] == ' ' || \
>  	 line[sizeof(name) - 1] == '\t'))
>  
> -	if ((fp = fopen(_PATH_RESCONF, "rc")) != NULL) {
> +	rconf_name = getenv (ENV_RESOLVCONF);

How about using __secure_getenv() instead of getenv() and adding
"RESOLV_CONF\0" to the UNSECURE_ENVVARS list?


-- 
ldv

Attachment: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]