Skip to content

Commit fb128b2

Browse files
committed
metaconfig/named: fix validation of logging channels in categories
Fixes #1784
1 parent 124f057 commit fb128b2

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

ncm-metaconfig/src/main/metaconfig/named/pan/schema.pan

+7-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ declaration template metaconfig/named/schema;
77

88
include 'pan/types';
99

10-
type named_acl_name = string with
11-
exists ("/software/components/metaconfig/services/{/etc/named.conf}/contents/acls/" + SELF) ||
10+
type named_acl_name = string with exists (
11+
format("/software/components/metaconfig/services/{/etc/named.conf}/contents/acls/", SELF)) ||
1212
match (SELF, "^(none|localhost|any|localnets)$") ||
13-
error ("ACL with name " + SELF + " is not defined");
13+
error ("ACL with name %s is not defined", SELF);
1414

1515
type named_source = {
1616
"ip" ? type_ip
@@ -95,9 +95,10 @@ type named_zone = {
9595
true;
9696
};
9797

98-
type named_channel_name = string with
99-
exists ("/software/components/metaconfig/services/{/etc/named.conf}/contents/logging/" + SELF) ||
100-
error (SELF + " doesn't refer to a logging channel");
98+
type named_channel_name = string with exists (
99+
format("/software/components/metaconfig/services/{/etc/named.conf}/contents/logging/channels/%s", SELF)) || error (
100+
"%s doesn't refer to a logging channel", SELF,
101+
);
101102

102103
@{
103104
Named log parameters

ncm-metaconfig/src/main/metaconfig/named/tests/profiles/config.pan

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ prefix "/software/components/metaconfig/services/{/etc/named.conf}/contents";
66

77
"logging/channels/default_debug" = dict (
88
"severity", "dynamic",
9-
"file", "data/named.run");
10-
"logging/category" = dict();
9+
"file", "data/named.run"
10+
);
11+
"logging/category" = dict(
12+
"queries", list("default_debug"),
13+
);
1114
"includes" = append("/etc/named.rfc1912.zones");
1215
"includes" = append("/etc/another.conf");
1316

0 commit comments

Comments
 (0)