! ----- READ_NON_PRIVILEGED_IDENTIFIERS.FUN ----- ! ! ----- SUBROUTINE TO READ IN ALL IDENTIFIERS WHICH CAN BE GRANTED ----- ! ----- BY NON-PRIVILEGED USERS ----- ! ! ---------- Restrictions: ---------- ! ! ----- 1) The RIGHTSLIST.DAT file on the local node must be opened ! ! ---------- PASSED: ---------- ! ! ----- HELD_DIVS_CTR = Count of held divisional identifiers ! ! ----- HELD_DIVS(1->HELD_DIVS_CTR) = Held divisional ! ----- identifiers ! ! ---------- RETURNED: ---------- ! ! ----- NON_PRIV_IDENT_CTR = Count of non-privileged identifiers ! ! ----- NON_PRIV_IDENTS(1->NON_PRIV_IDENT_CTR) = Non-privileged ! ----- identifiers ! ! ----- Last Change 07/16/93 by Brian Lomasky ----- ! SUB READ_NON_PRIVILEGED_IDENTIFIERS %INCLUDE "NUSER.INC" DECLARE WORD ERR_FLAG ! LOCAL ERROR FLAG DECLARE WORD TEMP ! TEMPORARY WORD VARIABLE DECLARE STRING TEMP_STRING ! TEMPORARY STRING NON_PRIV_IDENT_CTR = 0% ! INIT COUNT OF IDENTIFIERS ERR_FLAG = FALSE ! INIT ERROR FLAG EXTERNAL WORD FUNCTION & VALIDATE_IDENTIFIER ! FALSE IF IDENTIFIER EXISTS WHEN ERROR IN OPEN "TOOLS:NUSER_NONPRIV_IDENTIFIERS.DAT" & FOR INPUT AS FILE #99%, & SEQUENTIAL, ACCESS READ, ALLOW READ, & RECORDTYPE ANY USE IF ERR = FILE_NOT_FOUND THEN ERR_FLAG = 111% ! STORE SPECIAL CODE TO EXIT CONTINUE END IF IF ERR = PROTECTION_VIOLATION THEN PRINT "You do not have the privilege" + & " to open TOOLS:" + & "NUSER_NONPRIV_IDENTIFIERS.DAT" + BEL ERR_FLAG = TRUE CONTINUE END IF IF ERR = CANNOT_OPEN_FILE THEN PRINT "Error - Can't open any existing" & + " TOOLS:" + & "NUSER_NONPRIV_IDENTIFIERS.DAT" & + " file" + BEL PRINT "VMS error status value:"; VMSSTATUS ERR_FLAG = TRUE CONTINUE END IF PRINT "VMS error status value:"; VMSSTATUS EXIT HANDLER END WHEN EXIT SUB IF ERR_FLAG = 111% ! SPECIAL EXIT CODE IF NO FILE CALL SYS$EXIT(ERROR_WITH_NO_PUTMSG BY VALUE) IF ERR_FLAG WHILE NOT ERR_FLAG WHEN ERROR IN LINPUT #99%, TEMP_STRING USE IF ERR = END_OF_FILE THEN ERR_FLAG = TRUE CONTINUE END IF PRINT PRINT "Unexpected BASIC Error " + & NUM1$(ERR) + & " while reading TOOLS:" + & "NUSER_NONPRIV_IDENTIFIERS.DAT" + BEL PRINT "VMS error status value:"; VMSSTATUS EXIT HANDLER END WHEN IF NOT ERR_FLAG THEN IF NON_PRIV_IDENT_CTR > MAX_NON_PRIV_IDS THEN PRINT "Error - Too many" + & " non-privileged" + & " identifiers found in" PRINT " TOOLS:" + & "NUSER_NONPRIV_IDENTIFIERS.DAT"& + " - Increase" + & " MAX_NON_PRIV_IDS in" + BEL PRINT " NUSER.INC and recompile" CALL SYS$EXIT( & ERROR_WITH_NO_PUTMSG BY VALUE) END IF ! ----- REMOVE ANY SPACES ----- TEMP_STRING = EDIT$(TEMP_STRING, 2%) ! ----- SKIP ANY COMMENT LINES ----- ITERATE IF LEFT(TEMP_STRING, 1%) = "!" IF LEN(TEMP_STRING) < 1% OR & LEN(TEMP_STRING) > 32% THEN PRINT "%Bad " + & "NUSER_NONPRIV_IDENTIFIERS.DAT"& + " line #" + & NUM1$(NON_PRIV_IDENT_CTR& + 1%) + " - Wrong length" + BEL CALL SYS$EXIT( & ERROR_WITH_NO_PUTMSG BY VALUE) END IF NON_PRIV_IDENT_CTR = NON_PRIV_IDENT_CTR + 1% NON_PRIV_IDENTS(NON_PRIV_IDENT_CTR) = & TEMP_STRING END IF NEXT CLOSE #99% ! ----- SEE IF THE EDOOR IDENTIFIER EXISTS FOR HELD ----- ! ----- DIVISIONS ----- TEMP = 0% WHILE TEMP < HELD_DIVS_CTR TEMP = TEMP + 1% THE_IDENT = HELD_DIVS(TEMP) + "DOOR" ! ----- SEE IF THE IDENTIFIER (THE_IDENT) EXISTS ----- IF NOT VALIDATE_IDENTIFIER THEN NON_PRIV_IDENT_CTR = NON_PRIV_IDENT_CTR + 1% NON_PRIV_IDENTS(NON_PRIV_IDENT_CTR) = THE_IDENT END IF NEXT END SUB