Security Management Guide (G06.24+, H06.03+)

TACL Macros
Security Management Guide522283-008
C-7
Example 5. Lock Routine
#set :^wrongs ???*
]
== if user says "lock !", allow infinite wrong guesses
#set :^prompt Password?
#inputv /noecho/ :^pw1 :^prompt
== fetch user's desired password
[#if [#inputeof]
|then|
#raise EXIT
]
== if ^Y on input, abort routine
:^toascii :^pw1
== change ABC into 065066067 (and so on)
[#if (not [#match ????????????* [:^pw1]])
|then|
#output Password must be at least [
]three characters... aborting.
#raise EXIT
]
== if less than 4 characters, abort routine
#set :^prompt Repeat Password?
#inputv /noecho/ :^pw2 :^prompt
[#if [#inputeof]
|then|
#raise EXIT
]
== again, if ^Y on input, abort routine
:^toascii :^pw2
== change second password into numbers too, for comparison
[#if (not [_comparev :^pw1 :^pw2])
|then|
#output Passwords didn't match... aborting.
#raise EXIT
]
== abort if not identical
#filter MAIN
#raise MAIN
== jump to main loop by triggering "false" exception
| MAIN |
#filter MAIN _BREAK
[#output [:^_clschars]This terminal is locked by [
][#username [#processinfo /paid/]]. [
]Press BREAK to continue.]
== show main message at top of cleared screen
sink [#pause [#processinfo /processid/]]
== wait for a break (jump to _BREAK then)
#raise MAIN [|if not a break (for example, WAKE of TACL)|]
| _BREAK |
#filter MAIN _BREAK EXIT
== establish ways out of here
#set :^prompt Password or "logoff":
== is this right user? prove it!
#inputv /noecho/ :^pw2 :^prompt
#set :^prompt logoff
[#if [_comparev :^prompt :^pw2]