Wednesday, January 31, 2001
Binding BIND
I downloaded BIND 8.2.3 and in poking around the source code, found the offending code that prevented the parsing of DNS zone files in a certain format. It was a one line modification to fix the problem:
bind/src/bin/named/db_load.c:1594
#ifndef BIND_UPDATE
static
#endif
int
getnonblank(FILE *fp, const char *src, int multiline) {
int c;
multiline = 1; /* hack to fix --spc */
while ((c = getc(fp)) != EOF) {
if (isspace(c)) {
if (c == '\n') {
if (multiline)
lineno++;
else
goto eol;
}
continue;
}
if (c == ';') {
while ((c = getc(fp)) != EOF && c != '\n')
;
if (c == '\n') {
if (multiline)
lineno++;
else
goto eol;
}
continue;
}
return (c);
}
ns_info(ns_log_db, "%s:%d: unexpected EOF", src, lineno);
return (EOF);
eol:
ns_error(ns_log_db, "%s:%d: unexpected end of line", src, lineno);
/* don't ungetc(c, fp); as the caller will do this. */
return(c);
}
Sigh.
![Glasses. Titanium, not steel. [Self-portrait with my new glasses]](https://www.conman.org/people/spc/about/2025/0925.t.jpg)