• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 12595591960

03 Jan 2025 09:27AM UTC coverage: 62.774% (+2.5%) from 60.245%
12595591960

Pull #15008

github

web-flow
Merge c2a2749d3 into 788f396a7
Pull Request #15008: Do not follow CNAME records for ANY or CNAME queries

30393 of 78644 branches covered (38.65%)

Branch coverage included in aggregate %.

105822 of 138350 relevant lines covered (76.49%)

4613078.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.48
/pdns/bindparserclasses.hh
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22
#pragma once
23
#include <string>
24
#include <map>
25
#include <vector>
26
#include <set>
27
#include <stdio.h>
28
#include <sys/stat.h>
29

30
#include "namespaces.hh"
31

32
class BindDomainInfo 
33
{
34
public:
35
  BindDomainInfo() : hadFileDirective(false), d_dev(0), d_ino(0)
36
  {}
2✔
37

38
  void clear() 
39
  {
11✔
40
    name=DNSName();
11✔
41
    filename=type="";
11✔
42
    primaries.clear();
11✔
43
    alsoNotify.clear();
11✔
44
    d_dev=0;
11✔
45
    d_ino=0;
11✔
46
  }
11✔
47
  DNSName name;
48
  string viewName;
49
  string filename;
50
  vector<ComboAddress> primaries;
51
  set<string> alsoNotify;
52
  string type;
53
  bool hadFileDirective;
54
    
55
  dev_t d_dev;
56
  ino_t d_ino;
57

58
  bool operator<(const BindDomainInfo& b) const
59
  {
×
60
    return pair(d_dev, d_ino) < pair(b.d_dev, b.d_ino);
×
61
  }
×
62
};
63

64
extern const char *bind_directory;
65
extern FILE *yyin;
66
class BindParser
67
{
68
 public:
69
  BindParser() : d_dir("."), d_verbose(false)
70
  {
1✔
71
    yyin=0;
1✔
72
    extern int include_stack_ptr;
1✔
73
    include_stack_ptr=0;
1✔
74
 
75
    bind_directory=d_dir.c_str(); 
1✔
76
  }
1✔
77
  ~BindParser()
78
  {
1✔
79
    if(yyin) {
1!
80
      fclose(yyin);
1✔
81
      yyin=0;
1✔
82
    }
1✔
83
  }
1✔
84
  void parse(const string &fname);
85
  void commit(BindDomainInfo DI);
86
  void setDirectory(const string &dir);
87
  const string &getDirectory();
88
  const vector<BindDomainInfo>& getDomains();
89
  void setVerbose(bool verbose);
90
  void addAlsoNotify(const string &host);
91
  set<string> & getAlsoNotify() { return this->alsoNotify; } 
×
92
private:
93
  string d_dir;
94
  typedef map<DNSName,string> zonedomain_t;
95
  set<string> alsoNotify;
96
  vector<BindDomainInfo> d_zonedomains;
97
  bool d_verbose;
98
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc