Skip to content
Snippets Groups Projects
Commit 6912838e authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Updated zone ACL config syntax.

Commit refs #757.
parent 87d16b93
No related branches found
No related tags found
No related merge requests found
......@@ -107,23 +107,17 @@ zones {
server1;
}
# Alternative shorter ACL list specification
xfr-in server0, server1;
# ACL list specification for AXFR/IXFR OUT
xfr-out {
# Symbolic name for remote
server0;
}
xfr-out server0;
# ACL list specification for NOTIFY OUT
notify-in {
# Symbolic name for remote
server1;
}
notify-in server 0;
# ACL list specification for NOTIFY OUT
notify-out {
# Symbolic name for remote
server0;
}
notify-out server0;
}
}
......
......@@ -173,6 +173,43 @@ zone_acl_start:
}
;
zone_acl_item:
TEXT {
/* Find existing node in remotes. */
node* r = 0; conf_iface_t* found = 0;
WALK_LIST (r, new_config->remotes) {
if (strcmp(((conf_iface_t*)r)->name, $1) == 0) {
found = (conf_iface_t*)r;
break;
}
}
/* Append to list if found. */
if (!found) {
char buf[256];
snprintf(buf, sizeof(buf), "remote '%s' is not defined", $1);
cf_error(buf);
} else {
conf_remote_t *remote = malloc(sizeof(conf_remote_t));
if (!remote) {
cf_error("out of memory");
} else {
remote->remote = found;
add_tail(this_list, &remote->n);
}
}
/* Free text token. */
free($1);
}
;
zone_acl_list:
zone_acl_start
| zone_acl_list zone_acl_item ','
| zone_acl_list zone_acl_item ';'
;
zone_acl:
zone_acl_start '{'
| zone_acl TEXT ';' {
......@@ -243,6 +280,7 @@ zone_start: TEXT {
zone:
zone_start '{'
| zone zone_acl '}'
| zone zone_acl_list
| zone SEMANTIC_CHECKS BOOL ';' { this_zone->enable_checks = $3; }
| zone FILENAME TEXT ';' { this_zone->file = $3; }
;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment