X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/34a2240e6d24d133cd1ca0ab1845c57e28e9e9e5..0f15dd7b03058cb07e55d36ab36029081d556ffc:/src/setup.c diff --git a/src/setup.c b/src/setup.c index 211f425..f034f0f 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 @@ -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 } }; @@ -474,7 +504,6 @@ static int init_begin(adns_state *ads_r, adns_initflags flags, FILE *diagfile) { ads->forallnext= 0; ads->nextid= 0x311f; ads->udpsocket= ads->tcpsocket= -1; - ads->bug_if_query_done_now= 0; adns__vbuf_init(&ads->tcpsend); adns__vbuf_init(&ads->tcprecv); ads->tcprecv_skip= 0;