Deleted Added
full compact
1c1
< \ Copyright (c) 2006-2011 Devin Teske <dteske@FreeBSD.org>
---
> \ Copyright (c) 2006-2012 Devin Teske <dteske@FreeBSD.org>
25c25
< \ $FreeBSD: head/sys/boot/forth/check-password.4th 238431 2012-07-14 01:45:35Z dteske $
---
> \ $FreeBSD: head/sys/boot/forth/check-password.4th 244158 2012-12-12 17:49:01Z dteske $
77c77
< : read ( -- String prompt )
---
> : read ( String prompt -- )
137,139c137,148
< \ Exit if a password was not set
< s" password" getenv dup -1 = if
< drop exit
---
> \ Do not allow the user to proceed beyond this point if a boot-lock
> \ password has been set (preventing even boot from proceeding)
> s" bootlock_password" getenv dup -1 <> if
> begin
> s" Boot Password: " read ( prompt -- )
> 2dup readval readlen @ compare 0<>
> while
> 3000 ms ." loader: incorrect password" 10 emit
> repeat
> 2drop ( c-addr/u )
> else
> drop ( -1 ) \ getenv cruft
142c151,152
< begin \ Loop as long as it takes to get the right password
---
> \ Exit if a password was not set
> s" password" getenv -1 = if exit else drop then
144,145c154,155
< s" Password: " \ Output a prompt for a password
< read \ Read the user's input until Enter
---
> \ We should prevent the user from visiting the menu or dropping to the
> \ interactive loader(8) prompt, but still allow the machine to boot...
146a157,164
> 0 autoboot
>
> \ Only reached if autoboot fails for any reason (including if/when
> \ the user aborts/escapes the countdown sequence leading to boot).
>
> s" password" getenv
> begin
> s" Password: " read ( prompt -- )
150,155c168,169
<
< \ Bad Password
< 3000 ms
< ." loader: incorrect password" 10 emit
<
< again \ Not the right password; repeat
---
> 3000 ms ." loader: incorrect password" 10 emit
> again