Currently, the code references the "Administrators" group name directly in the following line:
if err := addUserToGroup(ctx, k.UserName, "Administrators"); err != nil {
(
|
if err := addUserToGroup(ctx, k.UserName, "Administrators"); err != nil { |
)
it's also happening in lines 131, 141 and 163
This approach fails on non-English Windows versions, where the group name differs (e.g., "Administradores" in Spanish or "Rendszergazda" in Hungarian).
💡 Suggested Fix:
Instead of using a hardcoded string, the code should reference the SID S-1-5-32-544, which is the universal identifier for the Administrators group across all Windows languages.
This ensures compatibility across different system locales.
Currently, the code references the "Administrators" group name directly in the following line:
if err := addUserToGroup(ctx, k.UserName, "Administrators"); err != nil {
(
guest-agent/google_guest_agent/windows_accounts.go
Line 141 in fd71fa0
it's also happening in lines 131, 141 and 163
This approach fails on non-English Windows versions, where the group name differs (e.g., "Administradores" in Spanish or "Rendszergazda" in Hungarian).
💡 Suggested Fix:
Instead of using a hardcoded string, the code should reference the SID S-1-5-32-544, which is the universal identifier for the Administrators group across all Windows languages.
This ensures compatibility across different system locales.