Guardian Programmer's Guide

Table Of Contents
Writing a Command-Interpreter Monitor ($CMON)
Guardian Programmer’s Guide 421922-014
23 - 14
Controlling Passwords
The following code fragment returns a display message to the TACL process following
receipt of an Illegal^logon^msg message:
CALL READUPDATEX(RECV^NUM,SBUFFER,RCOUNT,BYTES^READ);
IF BUFFER[0] = -53 THEN
BEGIN
ILLEGAL^LOGON^MSG ':=' BUFFER FOR BYTES^READ;
ILLEGAL^LOGON^REPLY.REPLYTEXT ':='
"Invalid logon string: ";
ILLEGAL^LOGON^REPLY.REPLYTEXT[11] ':='
[ILLEGAL^LOGON^MSG.LOGONSTRING FOR
BYTES^READ - 54,0];
SCAN ILLEGAL^LOGON^REPLY.REPLYTEXT[0] UNTIL 0 -> @LAST;
REPLY^LEN := 2 + @LAST - @ILLEGAL^LOGON^REPLY.REPLYTEXT;
CALL REPLYX(LOGON^REPLY,REPLY^LEN);
END;
Controlling Passwords
A $CMON process can control the ability of a user to change passwords. This
subsection describes how $CMON can provide this control for local passwords and
remote passwords.
When the User Requests to Change a Local Password
When a user requests to change a local password by issuing a PASSWORD
command, the PASSWORD process sends a Password^msg message to the $CMON
process. The $CMON reply indicates whether the user’s password can be changed
and contains optional display text.
The format of the Password^msg message is as follows:
Format of command-interpreter message -57 (Password^msg message):
STRUCT PASSWORD^MSG;
BEGIN
INT MSGCODE; ![0] value -57
INT USERID; ![1] user ID of user requesting
! a change of local password
INT CIPRI; ![2] initial priority of command
! interpreter
INT CIINFILE[0:11]; ![3] name of command file of
! TACL process
INT CIOUTFILE[0:11]; ![15] name of list file for the
! TACL process
END;