Skip to content

Commit

Permalink
metaconfig/named: fix validation of logging channels in categories
Browse files Browse the repository at this point in the history
Fixes #1784
  • Loading branch information
jouvin committed Dec 11, 2024
1 parent 124f057 commit 94c00a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
16 changes: 9 additions & 7 deletions ncm-metaconfig/src/main/metaconfig/named/pan/schema.pan
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ declaration template metaconfig/named/schema;

include 'pan/types';

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

type named_source = {
"ip" ? type_ip
Expand Down Expand Up @@ -95,9 +96,10 @@ type named_zone = {
true;
};

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

@{
Named log parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ prefix "/software/components/metaconfig/services/{/etc/named.conf}/contents";

"logging/channels/default_debug" = dict (
"severity", "dynamic",
"file", "data/named.run");
"logging/category" = dict();
"file", "data/named.run"
);
"logging/category" = dict(
"queries", list("default_debug"),
);
"includes" = append("/etc/named.rfc1912.zones");
"includes" = append("/etc/another.conf");

Expand Down

0 comments on commit 94c00a9

Please sign in to comment.