Login disk quota system for a Multi-user RSX11M V3.2 operating system S.B. Renes M. R. Stewart Western Electric Co. Western Electric Co. Dallas Works Northern Illinois Works Dallas, Texas Lisle, Illinois 1-214-288-2286 1-312-983-3326 A simple method of implementing a disk quota system can be accomplished by modifying the login task HELLO and optionally modifying the indirect command handler (...AT.). The modification of ...AT. described here provides a neat format for comments and also includes the unused .ASKQ statement which allows string input without echo. The added functionality to the indirect command handler is not necessary for the disk quota system, but is included as an extra goodie that does nice things for the quota implementation. The modification of ...AT. provides the statement .STOQ and special handling of lines that start with the character ";" (comments). The .STOQ statement allows the stopping of ...AT. without printing the message "@ ", and lines with ";" as the first character are printed without the ";" as part of the text. The additional functionality provided by modifying ...AT. should be clear from looking at the command file SYSLOGIN.CMD presented below. The .ASKQ statement is not used, but it should be enough to say that the statement has exactly the same syntax and behavior as the .ASKS statement without echoing the characters that are input. The modification of HELLO contains some changes that are not required for the disk quota system (e.g. lower case output and system identification) from which the reader is free to pick and choose. The changes involving the slaving of the login terminal and the use of the file LB:[1,2]SYSLOGIN.CMD are necessary to keep unauthorized users from subverting the quota system. Six modules of the indirect command handler need to be modified, and the module HELLO.MAC also has to be changed. In addition, SYSLOGIN.CMD has to be placed on LB:[1,2]. The system manager can edit SYSLOGIN.CMD to add user specific disk quota allocations; note - the default quota is 500. blocks. If the file LB:[1,2]LOGIN.CMD exists [RWED,RWED,RWED,RWE], the system manager will be notified of users who are "OVERQUOTA". The six modules of the indirect command handler that need to be modified are INDASK.MAC, INDAS1.MAC, INDERR.MAC, INDPRC.MAC, INDSU2.MAC, and INDSTP.MAC. These modules can be found in [12,10] of the source distribution. The SLP corrections for the six modules are listed below. **************************** INDASK *********************************** -2,2 .IDENT /04.10/ -27 ; MRS01 MANARD STEWART (WECO) ADDED ASKQ STATEMENT (4.10) ;MRS01 -44 RSX-11M V3.2 Disk Quota System Page 2 ASKQF:: .BYTE 0 ; ASK QUIETLY FLAG ;MRS01 -58 ASKQ:: MOVB #1,ASKQF ; ASK QUITELY NOW ;MRS01 / **************************** INDAS1 *********************************** -2,2 .IDENT /04.07/ -27 ; MRS01 MANARD STEWART (WECO) INCLUDED ASKQ STATEMENT (4.07) ; 10-SEP-80 ;MRS01 -99 TSTB ASKQF ; SHOULD WE BE QUIET? ;MRS01 BEQ 112$ ; NOT THIS TIME ;MRS01 CLRB ASKQF ; FOR THE NEXT TIME ;MRS01 MOV #IO.RNE,TIDPB+Q.IOFN ; SET TO READ NO ECHO ;MRS01 112$: ; REF LABEL ;MRS01 / **************************** INDERR *********************************** -2,2 .IDENT /04.18/ -36 ; MRS03 12-SEP-80 ADDED .STOQ STATEMENT (4.18) -152,152 TST STOQF ; Are we stopping quietly? ;MRS03 BNE 10$ ; Not this time ;MRS03 CALL PRMSG1 ; PRINT AFTER PROMPT 10$: ; Reference label ;MRS03 / **************************** INDPRC *********************************** -2,2 .IDENT /04.19/ -46,46 ; MRS01 10-SEP-80 ADD .ASKQ STATEMENT. (4.18) ; ; MRS02 12-SEP-80 ADD .STOQ STATEMENT. (4.19) -58 .ASCIZ /STOQ/ ;MRS02 -70 .ASCIZ /ASKQ/ ;MRS01 -98 .WORD STOQ ;MRS02 -110 .WORD ASKQ ;MRS01 / **************************** INDSTP *********************************** -2,2 .IDENT /01.02/ -30 ; MRS03 12-SEP-80 ;ADD .STOQ STATEMENT (1.02) -39 STOQ:: MOV #1,STOQF ; Set the stop flag ;MRS03 / **************************** INDSU2 *********************************** -2,2 .IDENT /04.14/ RSX-11M V3.2 Disk Quota System Page 3 -40,40 ; MRS02 12-SEP-80 CONTROL PRINTING OF ; AND ! COMMENTS... ; M. Stewart (WECO - Lisle, Ill) ; ; MRS03 12-SEP-80 INSERT WORD FOR STOQ STATEMENT -67 STOQF:: .WORD 0 ; Stop quietly flag word ;MRS03 -322,325 .IF DF R$$11D ;MRS02 .IFF ;MRS02 CMPB #';,(R1) ; A comment ;MRS02 BNE 22$ ; No then we need the > ;MRS02 INC R1 ; Skip over the ; ;MRS02 DEC R2 ; Two less in this case ;MRS02 21$: DEC R2 ; Lie about count... ;MRS02 BR 25$ ; Continue now ;MRS02 22$: CMPB #'!,(R1) ; Another flavor comment? ;MRS02 BEQ 21$ ; No comment ;MRS02 24$: .IFTF MOVB #'>,-(R1) ; Y - PREFIX 25$: .IFT -347 BEQ 30$ ; Skip out if nothing ;MRS02 / *********************************************************************** The modification of HELLO.MAC can be done using the SLP correction file given below. The user may wish to modify the correction file for his own installation. **************************** HELLO ************************************ -2,2 .IDENT /WECO/ .Enabl lc -96 ; MRS01 5-NOV-79 ALLOW WIZARD ACCESS WHEN LOGINS ARE DISABLED ;MRS01 ; ; Sbr01 5-Sep-80 Look for LB:[1,2]SYSLOGIN.CMD at Login. -117,117 ASSN: .ASCIZ %ASN XXNN:=SY:/LOGIN%<33> ;sbr01 -138,148 ACCT: .ASCIZ /Account or Name: / ;sbr01 PSWD: .ASCIZ /Password: / MS1: .ASCII <15><12>%Odprsx(60) RSX-11M BL% ;MRS01 MS1A: .ASCIZ % Multi-User System%<12> MS2: .BLKB 16. .ASCII /Logged on terminal / MS2A: .ASCIZ /XXXX:/ MS3: .ASCIZ /Good morning/ MS4: .ASCIZ /Good afternoon/ MS5: .ASCIZ /Good evening/ RSX-11M V3.2 Disk Quota System Page 4 MS6: .ASCIZ /What the hell are you doing up at this hour?/ -242,246 ; modify for LB:[1,2]SYSLOGIN.CMD LOGDSP: .WORD 4 ; .WORD DEVNAM ; .WORD 5. ; .WORD DIRNAM ; .WORD 12. ; -289,292 ; Look for system login procedure ;sbr01 LOGINC: .ASCIZ /@LB:[1,2]SYSLOGIN.CMD/<15> ; ;sbr01 LOGINN=LOGINC+9. LOGINU: .ASCII /[000,000]/ ; USER LOGIN.CMD UFD TEMPLATE MONTH: .ASCII /JanFebMarAprMayJunJulAugSepOctNovDec/ -442,444 ; BIT #FE.NLG,$FMASK ; ARE LOGINS DISABLED? ;MRS01 ; BEQ 701$ ; NO ;MRS01 ; JMP ERR7 ; YES ;MRS01 -465,466 ; BCC 41$ ; OKAY ;MRS01 BCC 4000$ ; OKAY ;MRS01 JMP ERR1 ; NO, SYNTAX ERROR 4000$: CMP #1,GRP ; CHECK IF THE WIZARD IS THERE. ;MRS01 BNE 4001$ ; NOT POSSIBLE ;MRS01 CMP #2,MEM ; POSSIBLE - CHECK FURTHER ;MRS01 BEQ 402$ ; IT IS HIM - DO NOT CHECK LOGIN ENAB ;MRS01 4001$: BIT #FE.NLG,$FMASK ; ARE LOGINS DISABLED ;MRS01 BEQ 402$ ; NO - OK TO CONTINUE ;MRS01 JMP ERR7 ; SAY - NO NO ;MRS01 402$: ; REFERENCE LABEL ;MRS01 -784,785 180$: -837,837 ; EXECUTE System LOGIN.CMD IF IT EXISTS -844,850 BCS 211$ ; THIS IS STRANGE ERROR CALL .FIND ; NOW LOOK FOR THAT FILE BCS 211$ ; BR IF NOT FOUND ; He doesnt have to know! ;sbr01 ; MOV #IO.WVB,ODPB+2 ; SET FUNCTION ; MOV #'+,ODPB+Q.IOPL+4 ; SET CARRIAGE CONTROL ; MOV #LOGINC,R0 ; SET COMMAND ADDRESS ; CALL WRIT ; PRINT COMMAND -867 211$: mov $tktcb,r0 ; get my tcb ;sbr01 mov t.ucb(r0),r1 ; get ti: ucb address ;sbr01 bic #u2.slv,u.cw2(r1); Unslave terminal only when no ;sbr01 ; System login file present. ;sbr01 br 210$ ; proceed ;sbr01 / *********************************************************************** RSX-11M V3.2 Disk Quota System Page 5 Finally, the actual command file SYSLOGIN.CMD used by one location is given below. The user may wish to modify this information to suit his own needs in implementing the quota system. Note the class of Users that are allowed to skip quota checking, and the quotas that are explicitly defined in the subroutine QUOTA. Also, note the extensive use of the undocumented and unsupported commands. If the reader is not acquainted with these commands he should refer to the Multi-tasker Vol 11, Number 4 (October, 1979). .ONERR 999 .ENABLE QUIET SET /SLAVE=TI: .ENABLE SUBSTITUTION .SETS UIC .PARSE UIC "[," PRE GR POST .IF GR EQ "1" .GOTO 50 .IF GR EQ "5" .GOTO 50 .DISABLE QUIET ; ; [Computing disk usage...] .GOSUB QUOTA .GOSUB ALLOCT .IF ALL LE QUO .SETN LEFT QUO-ALL .IF ALL GT QUO .SETN LEFT ALL-QUO ; ; Disk Quota: 'QUO' blocks ; Blocks allocated: 'ALL' ; Blocks written: 'USED' ; No. of files: 'FILES' ; .IF ALL LE QUO ; Space left: 'LEFT' blocks .IF ALL GT QUO ; Space left: -'LEFT' blocks ; .IF ALL LE QUO .GOTO 50 .SETN OVER ALL-QUO ; ; You have used 'ALL' blocks of disk space which ; is more than the 'QUO' blocks you are allowed. ; ; You must delete,truncate and/or purge your account ; of 'OVER' blocks to get below your allotment before ; you can finish logging in. ; ; You will be allowed to use PIP to do this. ; ; When you are ready to proceed, type ^Z and if you ; are at or below quota you can continue. ; Otherwise, you will be logged out! ; .ENABLE QUIET PIP .DISABLE QUIET ; [Recomputing disk usage...] .GOSUB ALLOCT .IF ALL LE QUO .GOTO 50 RSX-11M V3.2 Disk Quota System Page 6 .SETN OVER ALL-QUO .GOSUB NOTIFY ; ; You are still 'OVER' blocks over quota! ; Sorry... ; .GOTO 999 .50:.GOSUB LOGON .STOQ .QUOTA:.SETN QUO 500. .IF EQ "[230,37]" .SETN QUO 1000. .IF EQ "[360,1]" .SETN QUO 3000. .RETURN .ALLOCT:.ENABLE QUIET PIP QQQQQ.TMP=/TB .OPENR #1 QQQQQ.TMP .READ #1 JUNK .READ #1 RECORD .CLOSE #1 PIP QQQQQ.TMP;*/DE .PARSE RECORD "F ./.N ." A B USED C ALLOC D E FILE F .SETN ALL 'ALLOC'. .SETN FIL 'FILE'. .SETN FILES FIL-1. .DISABLE QUIET .RETURN .LOGON:.ENABLE QUIET SET /NOSLAVE=TI: .IFINS ...MAI MAIL ? .TESTFILE LOGIN.CMD .IF NE 1 .GOTO 1 .DISABLE QUIET @LOGIN .1:.DISABLE QUIET .RETURN .NOTIFY:.TESTFILE LB:[1,2]LOGIN.CMD .IF NE 1 .GOTO 1 .OPENA #1 LB:[1,2]LOGIN.CMD .DATA #1 ; User '' over quota by 'OVER' blocks at '