diff --git a/doc/man/knot.conf.5in b/doc/man/knot.conf.5in index 853aa8c6e7619bf1bc1010f3b5ab62b6f98fd000..89ba9a8e1450d659cefff6aef0b82a29981565ff 100644 --- a/doc/man/knot.conf.5in +++ b/doc/man/knot.conf.5in @@ -2110,10 +2110,12 @@ frequent updates), the serial is incremented instead. To avoid user confusion, use \fBdateserial\fP only if you expect at most 100 updates per day per zone and \fBunixtime\fP only if you expect at most one update per second per zone. +.sp +Generated catalog zones use \fBunixtime\fP only. .UNINDENT .UNINDENT .sp -\fIDefault:\fP increment +\fIDefault:\fP increment (unixtime for generated catalog zones) .SS refresh\-min\-interval .sp Forced minimum zone refresh interval (in seconds) to avoid flooding primary server. diff --git a/doc/reference.rst b/doc/reference.rst index d6b1e28a8297d3378f84ec75fec042d436ee538c..8685ecc5b85217db19f0e5822a5e5b4a14cd1043 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -2288,7 +2288,9 @@ Possible values: 100 updates per day per zone and ``unixtime`` only if you expect at most one update per second per zone. -*Default:* increment + Generated catalog zones use ``unixtime`` only. + +*Default:* increment (unixtime for generated catalog zones) .. _zone_refresh-min-interval: diff --git a/src/knot/conf/tools.c b/src/knot/conf/tools.c index 2096e1a08fa6bfa210e01deed2ef86dd86c546d5..05846115b5c94673b3f40a648d3fc50e93fbfa88 100644 --- a/src/knot/conf/tools.c +++ b/src/knot/conf/tools.c @@ -824,6 +824,8 @@ int check_zone( C_CATALOG_TPL, yp_dname(args->id)); conf_val_t catalog_zone = conf_zone_get_txn(args->extra->conf, args->extra->txn, C_CATALOG_ZONE, yp_dname(args->id)); + conf_val_t catalog_serial = conf_zone_get_txn(args->extra->conf, args->extra->txn, + C_SERIAL_POLICY, yp_dname(args->id)); if ((bool)(conf_opt(&catalog_role) == CATALOG_ROLE_INTERPRET) != (bool)(catalog_tpl.code == KNOT_EOK)) { args->err_str = "'catalog-role' must correspond to configured 'catalog-template'"; @@ -834,6 +836,12 @@ int check_zone( args->err_str = "'catalog-role' must correspond to configured 'catalog-zone'"; return KNOT_EINVAL; } + if (conf_opt(&catalog_role) == CATALOG_ROLE_GENERATE && + conf_opt(&catalog_serial) != SERIAL_POLICY_UNIXTIME && // Default doesn't harm. + catalog_serial.code == KNOT_EOK) { + args->err_str = "'serial-policy' must be 'unixtime' for generated catalog zones"; + return KNOT_EINVAL; + } return KNOT_EOK; }