Skip to content

Commit 94c00a9

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

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

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

+9-7
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ 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) ||
12-
match (SELF, "^(none|localhost|any|localnets)$") ||
13-
error ("ACL with name " + SELF + " is not defined");
10+
type named_acl_name = string with exists (
11+
format("/software/components/metaconfig/services/{/etc/named.conf}/contents/acls/", SELF)) || match (
12+
SELF, "^(none|localhost|any|localnets)$") || error (
13+
"ACL with name %s is not defined", SELF
14+
);
1415

1516
type named_source = {
1617
"ip" ? type_ip
@@ -95,9 +96,10 @@ type named_zone = {
9596
true;
9697
};
9798

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

102104
@{
103105
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)