Bug 60 - Zonec runs out of file descriptors with many zones
Zonec runs out of file descriptors with many zones
Product: NSD
Classification: Unclassified
Component: Zonec Code
All All
: P2 normal
Assigned To: NSD team
Depends on:
  Show dependency treegraph
Reported: 2003-07-17 11:50 CEST by Erik Rozendaal
Modified: 2003-10-30 16:03 CET (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Erik Rozendaal 2003-07-17 11:50:25 CEST
Hello NSD folks,

i found an error, while building the nsd.db via
nsdc rebuild (Version nsd-1.2.0):

zonec: reading zone "xxx0.yy.": 0 errors
zonec: writing zone "xxx0.yy.": done.
zonec: unable to open dominic-zones/xxx1.yy.zone: Too many open files
zonec: unable to open dominic-zones/xxx2.yy.zone: Too many open files
zonec: done with total 2 errors.

The zone-list-file contains only 251 zone-entries.
This happens on a
"SunOS xxx 5.9 Generic_112233-06 sun4u sparc SUNW,Sun-Fire-280R".

I fixed this problem in the file "zonec.c" simply adding
a line (line-nr: 582) to close the stream:

struct zone *
zone_read (char *name, char *zonefile)
        /* Open the zone file */
        if((parser = nsd_zopen(zonefile, 3600, CLASS_IN, name)) == NULL) {
                fprintf(stderr, "zonec: unable to open %s: %s\n", zonefile,
                return NULL;
+        /* Close the zone file */
+        fclose(parser->file);
        return z;

I hope it helps everybody else.

Best regard,

Wilhelm Zenz

Wilhelm Zenz       Email: zenz@digital-security.com
Tel: +49-2222-990-0   Web: www.digital-security.com
Fax: +49-2222-990-444           Web: www.dominic.de
DSS - Gesellschaft für Digitale Sicherheit mbH
Servatiusweg 19-23                   53332 Bornheim

nsd-users mailing list
Comment 1 Erik Rozendaal 2003-07-21 11:11:50 CEST
Close parser at end of zone_read.