+ * Reads /etc/resolv-adns.conf if it exists.
* New fanftest test program from Tony Finch (ignored by `make install').
* Declare flags parameters as enums again, not ints.
* New adnsresfilter general-purpose number->name mapping filter program.
* New fanftest test program from Tony Finch (ignored by `make install').
* Declare flags parameters as enums again, not ints.
* New adnsresfilter general-purpose number->name mapping filter program.
+ * Reads /etc/resolv-adns.conf if it exists.
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
- * $Id: adns.h,v 1.72 1999/11/02 21:02:39 ian Exp $
+ * $Id: adns.h,v 1.73 1999/11/07 19:15:36 ian Exp $
*/
#ifndef ADNS_H_INCLUDED
*/
#ifndef ADNS_H_INCLUDED
/* Configuration:
* adns_init reads /etc/resolv.conf, which is expected to be (broadly
/* Configuration:
* adns_init reads /etc/resolv.conf, which is expected to be (broadly
- * speaking) in the format expected by libresolv. adns_init_strcfg
- * is instead passed a string which is interpreted as if it were the
- * contents of resolv.conf. In general, configuration which is set
- * later overrides any that is set earlier.
+ * speaking) in the format expected by libresolv, and then
+ * /etc/resolv-adns.conf if it exists. adns_init_strcfg is instead
+ * passed a string which is interpreted as if it were the contents of
+ * resolv.conf or resolv-adns.conf. In general, configuration which
+ * is set later overrides any that is set earlier.
- * Standard directives understood in resolv.conf:
+ * Standard directives understood in resolv[-adns].conf:
*
* nameserver <address>
* Must be followed by the IP address of a nameserver. Several
*
* nameserver <address>
* Must be followed by the IP address of a nameserver. Several
* Each option consists of an option name, followed by optionally
* a colon and a value. Options are listed below.
*
* Each option consists of an option name, followed by optionally
* a colon and a value. Options are listed below.
*
- * Non-standard directives understood in resolv.conf:
+ * Non-standard directives understood in resolv[-adns].conf:
*
* clearnameservers
* Clears the list of nameservers, so that further nameserver lines
*
* clearnameservers
* Clears the list of nameservers, so that further nameserver lines
* include <filename>
* The specified file will be read.
*
* include <filename>
* The specified file will be read.
*
- * Additionally, adns will ignore lines in resolv.conf which start with a #.
+ * Additionally, adns will ignore lines in resolv[-adns].conf which
+ * start with a #.
*
* Standard options understood:
*
*
* Standard options understood:
*
* each case there is both a FOO and an ADNS_FOO; the latter is
* interpreted later so that it can override the former. Unless
* otherwise stated, environment variables are interpreted after
* each case there is both a FOO and an ADNS_FOO; the latter is
* interpreted later so that it can override the former. Unless
* otherwise stated, environment variables are interpreted after
- * resolv.conf is read, in the order they are listed here.
+ * resolv[-adns].conf are read, in the order they are listed here.
*
* RES_CONF, ADNS_RES_CONF
* A filename, whose contets are in the format of resolv.conf.
*
* RES_CONF, ADNS_RES_CONF
* A filename, whose contets are in the format of resolv.conf.
-static void readconfig(adns_state ads, const char *filename);
+static void readconfig(adns_state ads, const char *filename, int warnmissing);
static void addserver(adns_state ads, struct in_addr addr) {
int i;
static void addserver(adns_state ads, struct in_addr addr) {
int i;
configparseerr(ads,fn,lno,"`include' directive with no filename");
return;
}
configparseerr(ads,fn,lno,"`include' directive with no filename");
return;
}
}
static const struct configcommandinfo {
}
static const struct configcommandinfo {
-static void readconfig(adns_state ads, const char *filename) {
+static void readconfig(adns_state ads, const char *filename, int warnmissing) {
getline_ctx gl_ctx;
gl_ctx.file= fopen(filename,"r");
if (!gl_ctx.file) {
if (errno == ENOENT) {
getline_ctx gl_ctx;
gl_ctx.file= fopen(filename,"r");
if (!gl_ctx.file) {
if (errno == ENOENT) {
- adns__debug(ads,-1,0,"configuration file `%s' does not exist",filename);
+ if (warnmissing)
+ adns__debug(ads,-1,0,"configuration file `%s' does not exist",filename);
return;
}
saveerr(ads,errno);
return;
}
saveerr(ads,errno);
return;
}
filename= instrum_getenv(ads,envvar);
return;
}
filename= instrum_getenv(ads,envvar);
- if (filename) readconfig(ads,filename);
+ if (filename) readconfig(ads,filename,1);
}
static void readconfigenvtext(adns_state ads, const char *envvar) {
}
static void readconfigenvtext(adns_state ads, const char *envvar) {
ccf_options(ads,"RES_OPTIONS",-1,res_options);
ccf_options(ads,"ADNS_RES_OPTIONS",-1,adns_res_options);
ccf_options(ads,"RES_OPTIONS",-1,res_options);
ccf_options(ads,"ADNS_RES_OPTIONS",-1,adns_res_options);
- readconfig(ads,"/etc/resolv.conf");
+ readconfig(ads,"/etc/resolv.conf",1);
+ readconfig(ads,"/etc/resolv-adns.conf",0);
readconfigenv(ads,"RES_CONF");
readconfigenv(ads,"ADNS_RES_CONF");
readconfigenv(ads,"RES_CONF");
readconfigenv(ads,"ADNS_RES_CONF");