From 6d1bb90dcf25714ac5fec77278ee537c59409340 Mon Sep 17 00:00:00 2001 From: Ben Ford Date: Thu, 21 Aug 2025 19:52:30 -0700 Subject: [PATCH] treat windows service accounts as case insensitive Windows service accounts are *case preserving* but not *case sensitive*. Before this change, Windows service logon account names were compared directly as case sensitive. When there was a case mismatch, it was treated as a change to the account and the service was restarted. This now normalizes case before comparing, reducing spurious restarts. Co-authored-by: Ewoud Kohl van Wijngaarden --- lib/puppet/provider/service/windows.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/service/windows.rb b/lib/puppet/provider/service/windows.rb index 7c1477a91e..de6877791e 100644 --- a/lib/puppet/provider/service/windows.rb +++ b/lib/puppet/provider/service/windows.rb @@ -127,7 +127,7 @@ def logonaccount_insync?(current) @normalized_logon_account ||= normalize_logonaccount @resource[:logonaccount] = @normalized_logon_account - insync = @resource[:logonaccount] == current + insync = @resource[:logonaccount].casecmp?(current) self.logonpassword = @resource[:logonpassword] if insync insync end