From afe12b277de5ab300168b6e7dc6dd5a0abf8e87f Mon Sep 17 00:00:00 2001 From: "Matthew R. Kasun" Date: Mon, 6 Jun 2022 13:01:51 -0400 Subject: [PATCH] force lowercase for /etc/hosts profile names to test: create newtwork with Upper case name check profile in /etc/hosts is created with all lowercase --- netclient/functions/mqhandlers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netclient/functions/mqhandlers.go b/netclient/functions/mqhandlers.go index e70aa981..7902a965 100644 --- a/netclient/functions/mqhandlers.go +++ b/netclient/functions/mqhandlers.go @@ -244,7 +244,7 @@ func setHostDNS(dns, iface string, windows bool) error { if err != nil { return err } - profile.Name = iface + profile.Name = strings.ToLower(iface) profile.Status = types.Enabled if err := hosts.ReplaceProfile(profile); err != nil { return err @@ -264,7 +264,7 @@ func removeHostDNS(iface string, windows bool) error { if err != nil { return err } - if err := hosts.RemoveProfile(iface); err != nil { + if err := hosts.RemoveProfile(strings.ToLower(iface)); err != nil { if err == types.ErrUnknownProfile { return nil }