aboutsummaryrefslogtreecommitdiffstats
path: root/lib/isccfg
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2010-03-02 19:49:55 +0000
committerDoug Barton <dougb@FreeBSD.org>2010-03-02 19:49:55 +0000
commit841024d54f1f0a07feccf84d8938b00bc1f362b5 (patch)
treec470abc978aa6ca4f6b0033d7e09c8b7b09cd629 /lib/isccfg
parent51917575cfd35d6a201b010726ea7404a0f9bb7e (diff)
downloadsrc-841024d54f1f0a07feccf84d8938b00bc1f362b5.tar.gz
src-841024d54f1f0a07feccf84d8938b00bc1f362b5.zip
Vendor import of BIND 9.6.2vendor/bind9/9.6.2
Notes
Notes: svn path=/vendor/bind9/dist/; revision=204599 svn path=/vendor/bind9/9.6.2/; revision=204600; tag=vendor/bind9/9.6.2
Diffstat (limited to 'lib/isccfg')
-rw-r--r--lib/isccfg/aclconf.c23
-rw-r--r--lib/isccfg/api2
-rw-r--r--lib/isccfg/include/isccfg/namedconf.h6
3 files changed, 21 insertions, 10 deletions
diff --git a/lib/isccfg/aclconf.c b/lib/isccfg/aclconf.c
index ad3d58e2c148..92839e4d77fe 100644
--- a/lib/isccfg/aclconf.c
+++ b/lib/isccfg/aclconf.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: aclconf.c,v 1.22.34.2 2009/01/18 23:47:41 tbox Exp $ */
+/* $Id: aclconf.c,v 1.22.34.4 2009/10/01 23:47:17 tbox Exp $ */
#include <config.h>
@@ -168,26 +168,36 @@ convert_keyname(const cfg_obj_t *keyobj, isc_log_t *lctx, isc_mem_t *mctx,
* parent.
*/
static int
-count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx)
+count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx,
+ isc_boolean_t *has_negative)
{
const cfg_listelt_t *elt;
const cfg_obj_t *cacl = NULL;
isc_result_t result;
int n = 0;
+ if (has_negative != NULL)
+ *has_negative = ISC_FALSE;
+
for (elt = cfg_list_first(caml);
elt != NULL;
elt = cfg_list_next(elt)) {
const cfg_obj_t *ce = cfg_listelt_value(elt);
/* negated element; just get the value. */
- if (cfg_obj_istuple(ce))
+ if (cfg_obj_istuple(ce)) {
ce = cfg_tuple_get(ce, "value");
+ if (has_negative != NULL)
+ *has_negative = ISC_TRUE;
+ }
if (cfg_obj_istype(ce, &cfg_type_keyref)) {
n++;
} else if (cfg_obj_islist(ce)) {
- n += count_acl_elements(ce, cctx);
+ isc_boolean_t negative;
+ n += count_acl_elements(ce, cctx, &negative);
+ if (negative)
+ n++;
} else if (cfg_obj_isstring(ce)) {
const char *name = cfg_obj_asstring(ce);
if (strcasecmp(name, "localhost") == 0 ||
@@ -197,7 +207,8 @@ count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx)
strcasecmp(name, "none") != 0) {
result = get_acl_def(cctx, name, &cacl);
if (result == ISC_R_SUCCESS)
- n += count_acl_elements(cacl, cctx) + 1;
+ n += count_acl_elements(cacl, cctx,
+ NULL) + 1;
}
}
}
@@ -246,7 +257,7 @@ cfg_acl_fromconfig(const cfg_obj_t *caml,
int nelem;
if (nest_level == 0)
- nelem = count_acl_elements(caml, cctx);
+ nelem = count_acl_elements(caml, cctx, NULL);
else
nelem = cfg_list_length(caml, ISC_FALSE);
diff --git a/lib/isccfg/api b/lib/isccfg/api
index 8459d4239fcc..2240cdda3ac8 100644
--- a/lib/isccfg/api
+++ b/lib/isccfg/api
@@ -1,3 +1,3 @@
LIBINTERFACE = 50
-LIBREVISION = 0
+LIBREVISION = 1
LIBAGE = 0
diff --git a/lib/isccfg/include/isccfg/namedconf.h b/lib/isccfg/include/isccfg/namedconf.h
index 9689a2ae7bdd..55c5a81813aa 100644
--- a/lib/isccfg/include/isccfg/namedconf.h
+++ b/lib/isccfg/include/isccfg/namedconf.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: namedconf.h,v 1.9 2007/06/19 23:47:22 tbox Exp $ */
+/* $Id: namedconf.h,v 1.9.332.2 2009/06/25 23:47:28 tbox Exp $ */
#ifndef ISCCFG_NAMEDCONF_H
#define ISCCFG_NAMEDCONF_H 1
@@ -42,4 +42,4 @@ LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_rndckey;
LIBISCCFG_EXTERNAL_DATA extern cfg_type_t cfg_type_keyref;
/*%< A key reference, used as an ACL element */
-#endif /* ISCCFG_CFG_H */
+#endif /* ISCCFG_NAMEDCONF_H */