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") mainLog.Load().Debug().Msg("no active directory domain found")
return false 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 { for n, lc := range cfg.Listener {
if lc.Policy == nil { if lc.Policy == nil {
lc.Policy = &ctrld.ListenerPolicyConfig{} lc.Policy = &ctrld.ListenerPolicyConfig{}

View File

@@ -564,6 +564,12 @@ And within each policy, the rules are processed from top to bottom.
- Required: no - Required: no
- Default: [] - Default: []
---
Note that the domain comparisons are done in case in-sensitive manner following [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034#section-3.1)
---
### macs: ### macs:
`macs` is the list of mac rules within the policy. Mac address value is case-insensitive. `macs` is the list of mac rules within the policy. Mac address value is case-insensitive.