]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/bindparser.yy
Merge pull request #13387 from omoerbeek/rec-b-root-servers
[thirdparty/pdns.git] / pdns / bindparser.yy
index 4557c832a1de157865f12e683ac7317eb6cbfce1..179ca457617a39bbab6ea3aa1640ad5ac08a14ff 100644 (file)
@@ -36,7 +36,7 @@ extern int linenumber;
 static void yyerror(const char *str)
 {
   extern char *current_filename;       
-  throw PDNSException("Error in bind configuration '"+string(current_filename)+"' on line "+itoa(linenumber)+": "+str);
+  throw PDNSException("Error in bind configuration '"+string(current_filename)+"' on line "+std::to_string(linenumber)+": "+str);
 }
 
 extern FILE *yyin;
@@ -66,6 +66,9 @@ void BindParser::parse(const string &fname)
 void BindParser::setDirectory(const string &dir)
 {
        d_dir=dir;
+       if (d_dir.back() == '/') {
+               d_dir.pop_back();
+       }
        bind_directory=d_dir.c_str();
 }
 
@@ -105,7 +108,7 @@ void BindParser::commit(BindDomainInfo DI)
 %}
 
 %token AWORD QUOTEDWORD OBRACE EBRACE SEMICOLON ZONETOK FILETOK OPTIONSTOK
-%token DIRECTORYTOK ACLTOK LOGGINGTOK CLASSTOK TYPETOK MASTERTOK ALSONOTIFYTOK
+%token DIRECTORYTOK ACLTOK LOGGINGTOK CLASSTOK TYPETOK PRIMARYTOK ALSONOTIFYTOK
 
 %%
 
@@ -227,10 +230,10 @@ zone_command: command | global_zone_command | zone_also_notify_command
        ;
 
 /* zone commands that also are available at global scope */
-global_zone_command: zone_file_command | zone_type_command | zone_masters_command
+global_zone_command: zone_file_command | zone_type_command | zone_primaries_command
        ;
 
-zone_masters_command: MASTERTOK OBRACE masters EBRACE
+zone_primaries_command: PRIMARYTOK OBRACE primaries EBRACE
        ;
 
 zone_also_notify_command: ALSONOTIFYTOK OBRACE zone_also_notify_list EBRACE
@@ -248,14 +251,14 @@ zone_also_notify: AWORD
         }
         ;
 
-masters: /* empty */
+primaries: /* empty */
        | 
-       masters master SEMICOLON 
+       primaries primary SEMICOLON
        ;
 
-master: AWORD
+primary: AWORD
        {
-               s_di.masters.push_back(ComboAddress($1, 53));
+               s_di.primaries.push_back(ComboAddress($1, 53));
                free($1);
        }
        ;