From 89ce379cda44c13d330401eb5e4d63e3c6b1809a Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 28 Jun 2024 21:06:19 +0200 Subject: [PATCH] Fixes #37610 - pass the unencrypted root_pass to crypt for grub_pass self.root_pass can be already encrypted, and in the case of Base64(-Windows) we do not reliably detect that. And even if, using B64 for GRUB wouldn't work anyway. Fixes: 60d53c2621b3537e61e9082428ebb585f02fd3bc --- app/models/concerns/host_common.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/host_common.rb b/app/models/concerns/host_common.rb index 524b3e6d0af..5a61bddf6a5 100644 --- a/app/models/concerns/host_common.rb +++ b/app/models/concerns/host_common.rb @@ -152,8 +152,9 @@ def image_file end def crypt_passwords - self.root_pass = crypt_pass(self[:root_pass], :root) - self.grub_pass = crypt_pass(self[:grub_pass] || self[:root_pass], :grub) + root_pass = self[:root_pass] + self.root_pass = crypt_pass(root_pass, :root) + self.grub_pass = crypt_pass(self[:grub_pass] || root_pass, :grub) end def crypt_pass(unencrypted_pass, pass_kind)