X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/a627af120df28f62536f9ab47a950fafffb2b8ef..62ef470315d93ad327fee82c393589a21289a6d2:/src/setup.c?ds=inline diff --git a/src/setup.c b/src/setup.c index ac88c33..45ae044 100644 --- a/src/setup.c +++ b/src/setup.c @@ -8,8 +8,8 @@ * Copyright (C) 1997-1999 Ian Jackson * * It is part of adns, which is - * Copyright (C) 1997-1999 Ian Jackson - * Copyright (C) 1999 Tony Finch + * Copyright (C) 1997-2000 Ian Jackson + * Copyright (C) 1999-2000 Tony Finch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -267,6 +268,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 +308,7 @@ static const struct configcommandinfo { { "options", ccf_options }, { "clearnameservers", ccf_clearnss }, { "include", ccf_include }, + { "lookup", ccf_lookup }, /* OpenBSD */ { 0 } };