Commit 0846438f authored by Dominik Taborsky's avatar Dominik Taborsky

zone_update: add strict option for zone editing over ctl

parent 55ed76fa
......@@ -323,7 +323,7 @@ static int zone_txn_begin(zone_t *zone, ctl_args_t *args)
}
zone_update_flags_t type = (zone->contents == NULL) ? UPDATE_FULL : UPDATE_INCREMENTAL;
int ret = zone_update_init(zone->control_update, zone, type | UPDATE_SIGN);
int ret = zone_update_init(zone->control_update, zone, type | UPDATE_SIGN | UPDATE_STRICT);
if (ret != KNOT_EOK) {
free(zone->control_update);
zone->control_update = NULL;
......
......@@ -41,7 +41,8 @@ static int init_incremental(zone_update_t *update, zone_t *zone)
return ret;
}
apply_init_ctx(&update->a_ctx, update->new_cont, 0);
uint32_t apply_flags = update->flags & UPDATE_STRICT ? APPLY_STRICT : 0;
apply_init_ctx(&update->a_ctx, update->new_cont, apply_flags);
/* Copy base SOA RR. */
update->change.soa_from =
......
......@@ -53,6 +53,7 @@ typedef enum {
UPDATE_INCREMENTAL = 1 << 1, /*!< Apply changes to the old zone. */
UPDATE_SIGN = 1 << 2, /*!< Sign the resulting zone. */
UPDATE_DIFF = 1 << 3, /*!< In the case of full update, create a diff for journal. */
UPDATE_STRICT = 1 << 4, /*!< Apply changes strictly, i.e. fail when removing nonexistent RR. */
} zone_update_flags_t;
/*!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment