~andreserl/ubuntu/lucid/bind9/bind9-apport-533601

« back to all changes in this revision

Viewing changes to bin/check/check-tool.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2009-01-26 10:33:42 UTC
  • mfrom: (1.4.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090126103342-zfv3z8v6jgci62tg
* New upstream patch release
  - supportable version of fix from 9.5.0.dfsg.P2-5.1
  - CVE-2009-0025:  Closes: #511936
  - 2475: Overly agressive cache entry removal.  Closes: #511768
  - other bug fixes worthy of patch-release inclusion

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
 
2
 * Copyright (C) 2004-2008  Internet Systems Consortium, Inc. ("ISC")
3
3
 * Copyright (C) 2000-2002  Internet Software Consortium.
4
4
 *
5
5
 * Permission to use, copy, modify, and/or distribute this software for any
15
15
 * PERFORMANCE OF THIS SOFTWARE.
16
16
 */
17
17
 
18
 
/* $Id: check-tool.c,v 1.31 2007/09/13 04:45:18 each Exp $ */
 
18
/* $Id: check-tool.c,v 1.31.62.2 2008/10/24 01:44:15 tbox Exp $ */
19
19
 
20
20
/*! \file */
21
21
 
47
47
 
48
48
#include <isccfg/log.h>
49
49
 
 
50
#ifndef CHECK_SIBLING
 
51
#define CHECK_SIBLING 1
 
52
#endif
 
53
 
 
54
#ifndef CHECK_LOCAL
 
55
#define CHECK_LOCAL 1
 
56
#endif
 
57
 
50
58
#ifdef HAVE_ADDRINFO
51
59
#ifdef HAVE_GETADDRINFO
52
60
#ifdef HAVE_GAISTRERROR
60
68
                result = (r); \
61
69
                if (result != ISC_R_SUCCESS) \
62
70
                        goto cleanup; \
63
 
        } while (0)   
 
71
        } while (0)
64
72
 
65
73
#define ERR_IS_CNAME 1
66
74
#define ERR_NO_ADDRESSES 2
75
83
 
76
84
int debug = 0;
77
85
isc_boolean_t nomerge = ISC_TRUE;
 
86
#if CHECK_LOCAL
78
87
isc_boolean_t docheckmx = ISC_TRUE;
79
88
isc_boolean_t dochecksrv = ISC_TRUE;
80
89
isc_boolean_t docheckns = ISC_TRUE;
81
 
unsigned int zone_options = DNS_ZONEOPT_CHECKNS | 
 
90
#else
 
91
isc_boolean_t docheckmx = ISC_FALSE;
 
92
isc_boolean_t dochecksrv = ISC_FALSE;
 
93
isc_boolean_t docheckns = ISC_FALSE;
 
94
#endif
 
95
unsigned int zone_options = DNS_ZONEOPT_CHECKNS |
82
96
                            DNS_ZONEOPT_CHECKMX |
83
97
                            DNS_ZONEOPT_MANYERRORS |
84
98
                            DNS_ZONEOPT_CHECKNAMES |
85
99
                            DNS_ZONEOPT_CHECKINTEGRITY |
 
100
#if CHECK_SIBLING
 
101
                            DNS_ZONEOPT_CHECKSIBLING |
 
102
#endif
86
103
                            DNS_ZONEOPT_CHECKWILDCARD |
87
104
                            DNS_ZONEOPT_WARNMXCNAME |
88
105
                            DNS_ZONEOPT_WARNSRVCNAME;
109
126
        UNUSED(type);
110
127
        UNUSED(value);
111
128
        isc_mem_free(userarg, key);
112
 
 
129
}
113
130
 
114
131
static void
115
132
add(char *key, int value) {
376
393
        if (dns_name_countlabels(name) > 1U)
377
394
                strcat(namebuf, ".");
378
395
        dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
379
 
        
 
396
 
380
397
        result = getaddrinfo(namebuf, NULL, &hints, &ai);
381
398
        dns_name_format(name, namebuf, sizeof(namebuf) - 1);
382
399
        switch (result) {
459
476
        if (dns_name_countlabels(name) > 1U)
460
477
                strcat(namebuf, ".");
461
478
        dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
462
 
        
 
479
 
463
480
        result = getaddrinfo(namebuf, NULL, &hints, &ai);
464
481
        dns_name_format(name, namebuf, sizeof(namebuf) - 1);
465
482
        switch (result) {