``group.unique-id.zones.catalog. 0 IN TXT "conf-template"``
are processed as a definition of the member's *group* property. The
``unique-id`` must match the one of the PTR record defining the member.
+It's required that at most one group is defined for each member. If multiple
+groups are defined, one group is picked at random.
All other records and other member properties are ignored. They remain in the catalog
zone, however, and might be for example transferred to a secondary server,
-/* Copyright (C) 2022 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2023 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <stdio.h>
#include "knot/catalog/interpret.h"
+#include "knot/common/log.h"
#include "knot/journal/serialization.h"
struct cat_upd_ctx;
const knot_rdataset_t *txt = node_rdataset(node, KNOT_RRTYPE_TXT);
if (txt == NULL) {
return KNOT_EOK;
- } else if (txt->count != 1) {
- return KNOT_ERROR;
+ } else {
+ assert(txt->count >= 1);
}
const knot_rdataset_t *counter_txt = node_rdataset(binode_counterpart(node), KNOT_RRTYPE_TXT);
const char *newgr = "";
size_t grlen = 0;
if (!ctx->remove) {
- assert(txt->count == 1);
// TXT rdata consists of one or more 1-byte prefixed strings.
if (txt->rdata->len != txt->rdata->data[0] + 1) {
return KNOT_EMALF;
}
newgr = (const char *)txt->rdata->data + 1;
grlen = txt->rdata->data[0];
+ if (txt->count > 1) {
+ log_zone_warning(member, "member zone has multiple groups defined, picking '%.*s'",
+ (int)grlen, newgr);
+ }
assert(grlen <= CATALOG_GROUP_MAXLEN);
}
static int prop_verify(zone_node_t *node, cat_upd_ctx_t *ctx)
{
- if (label_eq(node->owner, CATALOG_GROUP_LABEL) &&
- rr_count(node, KNOT_RRTYPE_TXT) > 1) {
- return KNOT_EISRECORD;
- }
-
return KNOT_EOK;
}
# Move member between groups
up = master.update(zone)
up.delete("group.bar.zones.catalog2.", "TXT")
+up.add("group.bar.zones.catalog2.", 0, "TXT", "redundant-ignored")
up.add("group.bar.zones.catalog2.", 0, "TXT", "catalog-signed")
up.send("NOERROR")
t.sleep(4)
# Add member to a group
up = master.update(zone)
+up.add("group.baz.zones.catalog2.", 0, "TXT", "redundant-ignored")
up.add("group.baz.zones.catalog2.", 0, "TXT", "catalog-signed")
up.send("NOERROR")
t.sleep(4)