Skip to content

metaconfig/named: fix validation of logging channels in categories #1783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading