chiark / gitweb /
+ * Understand and sort of check OpenBSD `lookup' resolv.conf directive.
authorian <ian>
Tue, 9 Apr 2002 20:45:08 +0000 (20:45 +0000)
committerian <ian>
Tue, 9 Apr 2002 20:45:08 +0000 (20:45 +0000)
@@ -5,6 +5,7 @@
     (and there doesn't seem to be much explanation why).
+  * Understand and sort of check OpenBSD `lookup' resolv.conf directive.

changelog
src/setup.c

index 8c9a3acefb08db27f9fd627f6b6ef1104c6d5fe9..48fa272fdc88e2e363344fd693b6d29310bacbad 100644 (file)
--- a/changelog
+++ b/changelog
@@ -5,6 +5,7 @@ adns (1.1); urgency=medium
   * When search list runs out, _qf_owner sets owner to query domain.
   * Don't use <sys/select.h> any more, it was a mistake made in pre-1.0
     (and there doesn't seem to be much explanation why).
+  * Understand and sort of check OpenBSD `lookup' resolv.conf directive.
 
  --
 
index f4be5dd993d79ce366aa15b5decaac2f2b47fd39..f034f0f57e75564393b21e3541f388e114722030 100644 (file)
@@ -267,6 +267,35 @@ static void ccf_include(adns_state ads, const char *fn, int lno, const char *buf
   readconfig(ads,buf,1);
 }
 
+static void ccf_lookup(adns_state ads, const char *fn, int lno,
+                      const char *buf) {
+  int found_bind=0;
+  const char *word;
+  int l;
+
+  if (!*buf) {
+    configparseerr(ads,fn,lno,"`lookup' directive with no databases");
+    return;
+  }
+
+  while (nextword(&buf,&word,&l)) {
+    if (l==4 && !memcmp(word,"bind",4)) {
+      found_bind=1;
+    } else if (l==4 && !memcmp(word,"file",4)) {
+      /* ignore this and hope /etc/hosts is not essential */
+    } else if (l==2 && !memcmp(word,"yp",2)) {
+      adns__diag(ads,-1,0,"%s:%d: yp lookups not supported by adns", fn,lno);
+      found_bind=-1;
+    } else {
+      adns__diag(ads,-1,0,"%s:%d: unknown `lookup' database `%.*s'",
+                fn,lno, l,word);
+      found_bind=-1;
+    }
+  }
+  if (!found_bind)
+    adns__diag(ads,-1,0,"%s:%d: `lookup' specified, but not `bind'", fn,lno);
+}
+
 static const struct configcommandinfo {
   const char *name;
   void (*fn)(adns_state ads, const char *fn, int lno, const char *buf);
@@ -278,6 +307,7 @@ static const struct configcommandinfo {
   { "options",           ccf_options     },
   { "clearnameservers",  ccf_clearnss    },
   { "include",           ccf_include     },
+  { "lookup",            ccf_lookup      }, /* OpenBSD */
   {  0                                   }
 };