.TITLE CHKPRV .IDENT /V01/ .SBTTL DESCRIPTION ; ; ; COMPONENT: CHKPRV ; ; DATE: 27-JUN-79 ; ; AUTHOR: GR JOHNSON ; BATTELLE NORTHWEST ; P O BOX 999 ; RICHLAND WA 99352 ; ; SOURCE: MACRO-11 ; ; CALLER: FORTRAN IV-PLUS ; ; CALLING SEQUENCE: ; ; CALL CHKPRV(UIC,[ISW]) ; ; UIC = LITERAL SPECIFYING THE PRIVILEGED UIC. ; ; ISW = OPTIONAL INTEGER TO RECEIVE THE INTEGER STATUS. ; ; 00 = COMPLETE PRIVILEGES ; -01 = NON-PRIVILEGED USER ; ; ; IF THE ARGUMENT IS NOT SUPPLIED AND A PRIVILEGE ; VIOLATION OCCURS, THE PROGRAM IS ABORTED WITH ; THE FOLLOWING ERROR MESSAGE: ; ; You do not have the privilege to issue this command ; ; ; DESCRIPTION: ; ; "CHKPRV" VERIFIES USER PRIVILEGES AS DEFINED BY THE CALLING TASK'S ; DEFAULT UIC. ; ; .SBTTL ENTRY POINT -- TEST FOR PRIVILEGED UIC ; ; ; .PSECT ; .MCALL GTSK$S ; .MCALL EXST$S ; .MCALL QIOW$S ; .MCALL OTSWA,$AOTS ; IN [11,40]F4P.MAC OTSWA ; DEFINE OTS OFFSETS ; CHKPRV:: ; ; ; CONVERT ASCII UIC CLR R0 ; CLEAR CHARACTER COUNT MOV 2(R5),R1 ; STRING ADDRESS TO R1 MOV #DSDB,R2 ; DSDB ADDRESS TO R2 MOV #UICB,R3 ; UIC BUFFER ADDRESS TO R3 MOV R1,D.DSNM(R2) ; STRING ADDRESS INTO DSBD 2$: TSTB (R1)+ ; END-OF-STRING? BEQ 4$ ; YES, BRANCH FROM LOOP INC R0 ; NO, INCREMENT CHARACTER COUNT BR 2$ ; AND CONTINUE SCANNING FOR EOS 4$: MOV R0,D.DSLN(R2) ; STRING LENGTH INTO DSDB CALL .ASCPP ; CALL UIC CONVERSION BCS EXIT ; EXIT ON ERROR ; ; FETCH USER'S DEFAULT UIC MOV #TSKB,R4 ; TASK PARAMETER BUFFER ADDRESS TO R4 GTSK$S R4 ; FETCH TASK PARAMETERS ; CLR R0 ; CLEAR ISW FLAG CMP (R3),G.TSDU(R4) ; COMPARE UIC'S BEQ RTN ; RETURN TO CALLER IF EQUAL MOV #-1,R0 ; OTHERWISE SET ISW FLAG CMPB #2,(R5) ; TWO ARGUMENTS? BGT EXIT ; NO, ABORT PROGRAM TST 4(R5) ; NULL ARGUMENT? BLT EXIT ; YES, ABORT PROGRAM ; RTN: CMPB #2,(R5) ; TWO ARGUMENTS? BGT 2$ ; NO, RETURN TO CALLER TST 4(R5) ; NULL ARGUMENT? BLT 2$ ; YES, RETURN TO CALLER MOV R0,@4(R5) ; NO, RETURN STATUS 2$: RTS PC ; RETURN TO CALLER (R0 = ISW) ; EXIT: $AOTS ; ADDRESS OF IMPURE OTS INTO R3 MOV #EXMSG,EXADDR(R3) ; SET EXIT ADDRESS JMP $EXIT ; JUMP TO FORTRAN EXIT ROUTINE ; ; EXMSG: QIOW$S #IO.WLB!TF.WAL,#5,#1,,,,<#EXMTXT,#EXMLEN,#040> RTS PC ; ; .EVEN ; ; DSDB: .WORD 0,0 ; DIRECTORY-STRING DESCRIPTOR BLOCK ; D.DSLN=0 ; DSDB STRING LENGTH OFFSET D.DSNM=2 ; DSDB STRING ADDRESS OFFSET ; UICB: .WORD 0 ; UIC CONVERSION BUFFER ; TSKB: .BLKW 20 ; TASK PARAMETERS BUFFER ; .ENABL LC EXMTXT: .ASCII /You do not have the privilege to issue this command/ .ASCII <015><012> EXMLEN=.-EXMTXT ; EXIT MESSAGE LENGTH ; .END ;