loader: lua: disable autoboot timer after password entry

In the lua loader, if one sets a password in loader.conf, the
autoboot_delay timer will start before the menu is displayed.  One can
interrupt the autoboot and bring up the menu by entering a keyboard
character before the timer expires.

If this is done a prompt for the password is displayed.  Entering the
password will bring up the menu, but the timer will again start and
another keyboard character must be entered or autoboot will abort the
menu and boot the system.

PR:		265472
Reviewed by:	kevans
MFC after:	3 days
This commit is contained in:
Cyrus Rahman 2023-04-15 21:30:41 -05:00 committed by Kyle Evans
parent d7584aa09f
commit 0ab68e9272

View File

@ -135,6 +135,7 @@ function password.check()
local pwd = loader.getenv("password")
if pwd ~= nil then
core.autoboot()
loader.setenv("autoboot_delay", "NO")
-- The autoboot sequence was interrupted, so we'll need to
-- prompt for a password. Put the screen back into a known
-- good state, otherwise we're drawing back a couple lines