cmd/cli: lowercase AD domain to be consistent with network rules

While at it, also add a note that the domain comparison are done in
case-insensitive manner.
This commit is contained in:
Cuong Manh Le
2024-11-12 15:48:01 +07:00
committed by Cuong Manh Le
parent da91aabc35
commit 484643e114
2 changed files with 9 additions and 0 deletions

View File

@@ -18,6 +18,9 @@ func addExtraSplitDnsRule(cfg *ctrld.Config) bool {
mainLog.Load().Debug().Msg("no active directory domain found")
return false
}
// Network rules are lowercase during toml config marshaling,
// lowercase the domain here too for consistency.
domain = strings.ToLower(domain)
for n, lc := range cfg.Listener {
if lc.Policy == nil {
lc.Policy = &ctrld.ListenerPolicyConfig{}