BIND 10 #2428: support $INCLUDE in dns::MasterLoader

BIND 10 Development do-not-reply at isc.org
Wed Dec 12 08:12:47 UTC 2012


#2428: support $INCLUDE in dns::MasterLoader
-------------------------------------+-------------------------------------
            Reporter:  jinmei        |                        Owner:
                Type:  task          |  UnAssigned
            Priority:  medium        |                       Status:
           Component:  libdns++      |  reviewing
            Keywords:                |                    Milestone:
           Sensitive:  0             |  Sprint-20121218
         Sub-Project:  DNS           |                   Resolution:
Estimated Difficulty:  3             |                 CVSS Scoring:
         Total Hours:  0             |              Defect Severity:  N/A
                                     |  Feature Depending on Ticket:
                                     |  loadzone-ng
                                     |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------

Comment (by jinmei):

 I'd ask someone for giving it a full review (I don't think I'll have
 sufficient amount of time for this soonish), but I've noticed a few
 things while working on #2429, so I'm dumping them here:

 - for case insensitive comparison, we can use boost::iequals().
 - I suspect the use of strncasecmp() isn't correct:
 {{{#!cpp
         if (strncasecmp(directive, "INCLUDE", length) == 0) {
             doInclude();
 }}}
   If I understand it correctly, it (incorrectly) accepts "INCLUD".
   Note also that `MasterLexer` ensures `directive` is nul-terminated,
   so if we don't want to use boost here we should be able to use
   strcasecmp().
 - I'd confirm "$INCLUDE" (quoted) is accepted in tests.
 - In `doInclude()`, `filename_tok` could be of `StringRegion&`.  But
   maybe more important, if we build a string from it, I'd rather just
   extract a string from the beginning:
 {{{#!cpp
         const string filename =
 getNextToken(MasterToken::QSTRING).getString();
 }}}

-- 
Ticket URL: <http://bind10.isc.org/ticket/2428#comment:4>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list