Fix the import warning for allow-update { none; }; document CLI config paths
jarld import warned that zones with allow-update { none; } use dynamic
updates, though that turns them off (validation already allowed it).
docs/cli.md now gives the CLI configuration file's location on macOS and
Windows, not only ~/.config/jarl/config.yaml.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a3a1da54df
commit
b22ffee1bb
5 files changed
+59
-4
No files matched your search
@@ -477,7 +477,7 @@ func (im *importer) zone(s *namedconf.Stmt, v *model.View) error {
|
||||
}
|
||||
report.Records, report.Skipped = n, skipped
|
||||
for _, o := range opts {
|
||||
if kw := o.Keyword(); kw == "allow-update" || kw == "update-policy" {
|
||||
if kw := o.Keyword(); kw == "update-policy" || kw == "allow-update" && !allowsNone(o) {
|
||||
im.warn("zone %s uses %s (dynamic updates); Jarl rewrites zone files and won't apply such zones until %s is removed", dnsname.Display(z.Name), kw, kw)
|
||||
}
|
||||
}
|
||||
@@ -735,3 +735,18 @@ func ParseZoneText(zone, text string) (*ParsedZone, error) {
|
||||
}
|
||||
return pz, nil
|
||||
}
|
||||
|
||||
// allowsNone says whether an address match list option is { none; }
|
||||
// (allow-update { none; } turns dynamic updates off).
|
||||
func allowsNone(o *namedconf.Stmt) bool {
|
||||
b := o.FirstBlock()
|
||||
if b == nil {
|
||||
return false
|
||||
}
|
||||
for _, s := range b.Stmts {
|
||||
if namedconf.Compact(s.Items) != "none" {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
Reference in new issue
Block a user