From:	CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 20-MAR-1989 14:02
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Termlock v1.16, part 1 of 5


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Tue, 14 MAR 89 09:01:17 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Tue, 14 Mar 89 08:59:10 PST
Received: by ucbvax.Berkeley.EDU (5.61/1.36)
	id AA05034; Tue, 14 Mar 89 08:39:16 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 9 Mar 89 05:14:18 GMT
From: ssbell!mcmi!amperif!unocss!dent@uunet.uu.net  (Dave Caplinger)
Organization: U. of Nebraska at Omaha
Subject: Termlock v1.16, part 1 of 5
Message-Id: <702@unocss.UUCP>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com


$! ................... Cut between dotted lines and save. ...................
$!...........................................................................
$! VAX/VMS archive file created by VMS_SHARE V06.10 7-FEB-1989.
$!
$! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from
$! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au).
$!
$! To unpack, simply save, concatinate all parts into one file and
$! execute (@) that file.
$!
$! This archive was created by user UNOCC07
$! on  8-MAR-1989 01:53:55.16.
$!
$! ATTENTION: To keep each article below 31 blocks (15872 bytes), this
$!            program has been transmitted in 5 parts.  You should
$!            concatenate ALL parts to ONE file and execute (@) that file.
$!
$! It contains the following 4 files:
$!        TERMLOCK.DOC
$!        TERMLOCK.UPDATE
$!        TERMLOCK.C
$!        BUILD.COM
$!
$!============================================================================
$ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL )
$ VERSION = F$GETSYI( "VERSION" )
$ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK
$ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", -
    "VMS_SHARE V06.10 7-FEB-1989 requires VMS V4.4 or higher."
$ EXIT 44 ! SS$_ABORT
$VERSION_OK:
$ GOTO START
$!
$UNPACK_FILE:
$ WRITE SYS$OUTPUT "Creating ''FILE_IS'"
$ DEFINE/USER_MODE SYS$OUTPUT NL:
$ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION -
    VMS_SHARE_DUMMY.DUMMY
b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) )
; s_file_spec := GET_INFO( COMMAND_LINE, "output_file" ); SET( OUTPUT_FILE
, b_part, s_file_spec ); b_errors := CREATE_BUFFER( "{Errors}" ); i_errors 
:= 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN 
& "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; POSITION
( BEGINNING_OF( b_part ) ); LOOP EXITIF SEARCH( SPAN( ' ' )@r_trail 
& LINE_END, FORWARD) = 0; POSITION( r_trail ); ERASE( r_trail ); ENDLOOP
; POSITION( BEGINNING_OF( b_part ) ); i_append_line := 0; LOOP EXITIF MARK
( NONE ) = END_OF( b_part ); s_x := ERASE_CHARACTER( 1 )
; IF s_x = '+' THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip 
<> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF
; ENDIF; IF s_x = '-' THEN r_skip := SEARCH( pat_end, FORWARD, EXACT )
; IF r_skip <> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip 
:= MARK( NONE ); r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip 
<> 0 THEN POSITION( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET )
; MOVE_VERTICAL( 1 ); MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) 
); ENDIF; ERASE( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF
; IF s_x = 'V' THEN s_x := ''; IF i_append_line <> 0 THEN APPEND_LINE
; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF; i_append_line := 1
; MOVE_VERTICAL( 1 ); ENDIF; IF s_x = 'X' THEN s_x := ''; IF i_append_line 
<> 0 THEN APPEND_LINE; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF
; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> '' THEN i_errors 
:= i_errors + 1; s_text := CURRENT_LINE; POSITION( b_errors ); COPY_TEXT
( "The following line could not be unpacked properly:" ); SPLIT_LINE
; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ); MOVE_VERTICAL
( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH
( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ); ERASE_CHARACTER( 1 
); COPY_TEXT( ASCII( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDLOOP
; IF i_errors = 0 THEN SET( NO_WRITE, b_errors, ON ); ELSE POSITION
( BEGINNING_OF( b_errors ) ); COPY_TEXT( FAO
( "The following !UL errors were detected while unpacking !AS", i_errors
, s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" )
; ENDIF; EXIT; 
$ DELETE VMS_SHARE_DUMMY.DUMMY;*
$ CHECKSUM 'FILE_IS
$ WRITE SYS$OUTPUT " CHECKSUM ", -
  F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!!,passed." )
$ RETURN
$!
$START: 
$ FILE_IS = "TERMLOCK.DOC"
$ CHECKSUM_IS = 1970706359
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
VNote: TERMLOCK runs on VAX/VMS 4.7 or 5.0 using the JNET 3.2 or 3.3 software
X by`032
XJoiner Associates Inc, but the functionality is slightly different due to a
Xbug in JNET 3.3.  See further information in the text...
X
XTERMLOCK will work without the JNET software, but the program will not
Xsend automatic replies (Which almost defeats the purpose of the program).
X
VAdditionaly, TERMLOCK is VT-100 (or greater) specific.  If you have a termina
Xl
Xthat is not VT-100 compatable, are feel up to a little hacking, all of the
Xscreen-oriented code is in one place at the end of the source file.
X
X
X
X
X
X`009`009`009`009Termlock v1.16
X
X
X
X`009Termlock is a program to "lock" a user's terminal with a password to
Xeliminate the inconvenience of logging off and back on again.  Additionaly,
XTermlock keeps a log of messages received, and will automatically send
Xmessages indicating your absence to anyone PHONEing you or SENDing you a
Xmessage.  As it receives messages, it copies them to a file called
XTERMLOCK.LOG in your login directory (sys$login), and updates a counter on
Xthe screen.  This log file can be moved elsewhere by defining the full path
Xof where you want the log file to be in TERMLOCK$LOGFILE.  For example:
X
X$ DEFINE TERMLOCK$LOGFILE PERM$2:[UNOCC07.CONFIG]TERMLOCK.LOG
X
XMessage types and how they are handled by Termlock are as follows:
X
X`009`009(An "x" in the "Log" column indicates that
X`009`009 the message is copied to the TERMLOCK.LOG
X`009`009 file.  The "Reply" column indicates that
X`009`009 a reply is sent back to the message's`032
X`009`009 sender.  The "Display" column indicatates
X`009`009 that the message is echoed to the screen.
X`009`009 See below for more details.)
X
X`009Message Type`009`009`009       Log    Reply  Display
X
X`009SEND user "msg"`009`009`009`009x`009x`009      `032
X`009SEND user@node "msg"`009`009`009x`009x`009      `032
X`009SEND node::user "msg"`009`009`009x`009x`009      `032
X`009SEND/FILE file user`009`009`009x`009x`009      `032
X`009SEND/FILE file user@node`009`009x`009x`009      `032
X`009SEND/FILE file node::user`009`009x`009x`009      `032
X`009PHONE user`009`009`009`009x`009*
X`009PHONE node::user`009`009`009x`009*
X`009REPLY (from operator)`009`009`009x`009`009x     `032
X`009REPLY/URGENT`009`009`009`009x`009`009x     `032
X`009REPLY/SHUTDOWN`009`009`009`009x`009`009x     `032
X`009(New Mail...)`009`009`009`009x`009`009      `032
X`009(Job completed...)`009`009`009x`009`009      `032
X`009`009`009`009`009`009`009`009      `032
X`009* NOTE: Due to a bug in JNET 3.3, PHONE replies are not sent
X`009  if you are running JNET 3.3.  They /will/ be sent if you
X`009  run JNET 3.2 (or a fixed version of 3.3), however.
X
X`009  Also, messages received that begin with * are ignored.      `032
X`009  (This prevents replies to servers, other TERMLOCKs running  `032
X`009  at the same time, etc.)  Lastly, messages received from     `032
X`009  machines themselves (i.e. the response from something like  `032
X`009  SEND @UNOMA1 FINGER SUPERVISOR) are ignored.                   `032
X
X
XSince some messages (such as "SHUTDOWN - System going down in 1 minute") are
Xof some importance, REPLY messages are logged to the file and echoed to
Xthe screen.  This way, if the Termlock user happens to be near the terminal,
Xthey will be able to see any important messages that are sent.  No other
X"breakthrough" messages are supported.
X
X
X
X
X
X`009`009`009`009Using Termlock
X
X
X`009To use Termlock, define Termlock as an foreign command in your
XLOGIN.COM file with a line similar to this:
X
X`009$ LOCK :== "$PERM$2:[UNOCC07.BIN]TERMLOCK.EXE"
X
XThen, to start Termlock, just type:
X
X`009$ LOCK
X
XYou can specify a message for Termlock to send back to other users like this:
X
X`009$ LOCK "I'm taking a lunch break; Be back at 12:30."
X
XThe message can be up to 80 characters long.
X
X`009Once Termlock is started, you will see a "please wait" message, after
Xwhich, Termlock's main screen will appear. (If you have specified a log file,
Xor timeout, Termlock will display that as well as the "please wait" message.)
X
XCommands are entered simply by pressing the letter corresponding to the
Xcommand you want; no need to press <RETURN>.
X
X
XL : LOCK the terminal
X`009
X`009Pressing "L" will prompt you for a password and verification of
X`009that password.  If the two entries match, the terminal will be
X`009locked (signified by the word "LOCKED!" to the left of the
X`009"Selection:" prompt).
X
XU : UNLOCK the terminal
X
X`009Pressing "U" while the terminal is locked will prompt for the
X`009password used to lock the terminal, and unlock the terminal if
X`009the password was correct.  If the password was incorrect, the
X`009"Failed unlocks" counter on the screen will be incremented.
X`009Otherwise, "UNLOCKED!" will be displayed to the left of the
X`009"Selection:" prompt.
X
XE : EDIT message file
X
X`009If the terminal is unlocked, this will call TERMLOCK$EDIT to
X`009edit the SYS$LOGIN:TERMLOCK.LOG file.  By default, the editor
X`009used is EDT, but if TERMLOCK$EDIT contains "TPU", EVE will be
X`009used.  Once you are finished removing selected messages from
X`009the file, you will be returned to Termlock.
X
XV : VIEW message file
X
X`009If the terminal is unlocked, this will print the TERMLOCK.LOG
X`009file to the screen underneath the display.  If the file contains
X`009more than one screen-full of text, you will be prompted with
X`009an approximation of how much of the file has been shown (in
X`009percent) and "Press any key:".  At this point if you want to
X`009abort the listing, you can press "Q"; any other key will continue
X`009the listing.
X
XQ : QUIT this program
X
X`009If the terminal is unlocked, this will stop Termlock and return
X`009you to your DCL prompt.
X
X
X`009The "LOCKED!" or "UNLOCKED!" status has an effect on the commands.
XIf the terminal is locked, and you press "L" again, nothing will happen.
XLikewise, if the terminal is unlocked and you press "U", nothing will happen.
XIf the terminal is locked, however, and you press "E", "V", or "Q", you will
Xfirst be asked to unlock the terminal (just as if you had hit "U" before the
Xcommand) first.  If you supply the correct password, the terminal will be
Vunlocked (signified by the "UNLOCKED!" message to the left of the "Selection:
X"
Xprompt), the command will be executed, and the the terminal will be left in
Xthe unlocked state.  A failed unlock attempt will increment the "Failed
Xunlocks" counter and cancel the command.
X
X
X
XNEW FEATURES:
X
XTERMLOCK v1.16 now supports remote-command execution.  Remote commands are
Xsent to the TERMLOCK process by starting your SEND message with a ':'.
X
VFor example, say that user UNOCC07 is logged on in his office, running TERMLO
XCK.
XWhile in a public user room, he wants to know if he has any messages, so he
Xlogs on again at one of the public terminals, and does:
X
X$ send unocc07 ":status"
X
XHe will get back (in addition to the message he just sent himself) a status
Xline from the TERMLOCK process.
X
XThe remote commands are:
X
X`009:help`009`009`009`009get a list of commands
X`009:status`009`009`009`009get a status line
X`009:message new_message_text`009replace the reply message with all
X`009`009`009`009`009  following ":message" (spaces included)
X`009:logout`009`009`009`009log out the termlock process
X
X
XTERMLOCK v1.16 also supports an automatic time-out feature that will log
Xout the termlock process after a specified amount of time.  For sites whose
Xmanagers don't want lots of copies of termlock running all day, or hogging
Xpublic terminals, defining the logical TERMLOCK$SYSTEM_TIMEOUT in the system
Xlogical table as the maximum number of minutes to let a termlock process run
Xwill solve the problem.  Somethine along the lines of
X
X$ define/system TERMLOCK$SYSTEM_TIMEOUT 60
X
Xwill make all termlock processes run for at most 60 minutes.  Users can also
Xspecify their own timeouts (that cannot be longer than the system-wide one,
Xif defined) by defining TERMLOCK$TIMEOUT to be the maximum number of minutes
Vto run.  If TERMLOCK$SYSTEM_TIMEOUT is not defined, termlock processes will r
Xun
Xindefinitely (unless TERMLOCK$TIMEOUT is defined by the particular user).
X
XWhen a timeout is in effect, termlock will say so on start-up, and specify
Xwho put the timeout into effect (In case you try to specify a time greater
Xthan the system-wide time).  During execution of termlock, a display of how
Vmany minutes are left before timeout is printed above the "Selection:" prompt
X.
X
XWhen termlock times out, it logs the process off completely. (It does not
Xreturn the terminal to a DCL prompt)
X
X
X
X
X`009`009`009`009Addendum:
X
X
X`009There is one further command not displayed on Termlock's menu, that
Xis especially of use to people with multiple-session terminals.  If you run
VTermlock in one session, hit "break", connect to another session, and then us
Xe
Vctrl-N to switch back, you can use ctrl-W to redraw the screen (similar to ED
XT).
X
X`009If Termlock encounters a severe error, such as SYS$LOGIN:TERMLOCK.LOG
Xdisappearing because the disk it was on just crashed, it will log out the
Xcurrent process.  This is so a locked terminal won't suddenly print a stack-
Xdump and drop to the user's DCL prompt, leaving the account open to vandalism
Xfrom passers-by.  In the year it's been in use so far by beta-testers, this
Xhas not happened at all, but the possibility still exists that it might.  If
Xit does happen to you, please contact me.
X
X`009Termlock uses 1 subprocesses; if you start seeing messages printed to
Xyour screen on top of Termlock's display, this might be the cause.   Termlock
Vwill not be able to send reply messages back to senders without the subproces
Xs,
Vbut all other operations should work normally.  If you want automatic replies
X,
Xdelete any of your existing subprocesses, or ask your local system manager to
Xincrease your subprocess quota.
X
X
X
X
X
X`009`009`009`009Compiling
X
X
X
XTo compile Termlock, execute the BUILD.COM file.
X
X$ @build
X
XThe BUILD.COM file will determine (more-or-less) which version of JNET
Xyou are running, and compile Termlock appropriately with sharable libraries
Xto keep the executable size down to around 30 blocks.
X
X
XIf you have any questions, comments, suggestions, criticisms, etc, feel free
Xto contact me at any of the addresses below...
X
X-/ Dave Caplinger /------------------+-----------------------------------
X Microcomputer Specialist            `124  Internet: unocc07@zeus.unl.edu
X "Computing and Data Communications" `124  UUCP:     uunet!btni!unocss!dent
X University of Nebraska at Omaha     `124  Bitnet:   UNOCC07@UNOMA1
X Omaha, NE 68182                     `124    or      dc3a+@andrew.cmu.edu
X
$ GOSUB UNPACK_FILE

$ FILE_IS = "TERMLOCK.UPDATE"
$ CHECKSUM_IS = 874538299
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
XHello once again....
X
XFollowing will be a posting in 5 parts of Termlock v1.16.
X
XFor current users of Termlock, the differences between this version and the
Xlast public release (v1.07) are as follows (I hope I remember everything!):
-+-+-+-+-+ End of part 1 +-+-+-+-+-

