[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

1956.0. "A script to restore the ACLs on queues" by SIOG::T_REDMOND (Thoughts of an Idle Mind) Mon Dec 14 1992 11:17

    From the campground at U.S. Fall DECUS (last week).  A script that
    restores the Access Control List on queues if the queues have been
    reinitialized (for some reason).  This script uses the fact that an
    ALL-IN-1 group is created for each queue (plus one for all queues) and
    the QUI$QUEUE data set.
    
    Have fun, Tony
    
!+
!	RESTORE_QUEUE_ACLS.SCP
!+

	GET OA$DISPLAY = OA$_GBL_WORKING\FORCE

!	Initialize a number of variables -- not totally required, but it's
!	nice to set things up correctly in one place

	GET #MNG_OK = OA$Y
	GET #MNG_QUEUES_CHECK = 0
	GET #MNG_Q_ALL = "MNG$_Q_ALL"
	GET #MNG_Q_ALL_ID = "*MNG$_Q_ALL"
	GET #QUEUE_TYPE = "QUEUE"
	GET #QUEUE_ACCESS = "RE"

!	Check that a queue management group actually exists
	FOR FIRST GROUP$MASTER WITH .NAME:4 == "MNG$" -
	    DO GET #MNG_QUEUES_CHECK = 1

	.IF #MNG_QUEUES_CHECK EQ 0
	.THEN
	    YESNO_PROMPT -
		"No Management Group found for any queues - proceed? [Y/N] "
	    OA$FLD_STAY
 	    GET #MNG_OK = OA$PROMPT_TEXT
	    GET #MNG_PROMPT = OA$PROMPT_DISPOSE
	.END_IF

	.IF (#MNG_OK EQS OA$N) OR (#MNG_PROMPT NE 2) THEN .GOTO ABORT

.LABEL RESTORE_MNG_QUEUE_ALL
!	Create a temporary file containing details of all the management
!	groups on the system

	TEXT_FILE OPEN/WRITE QUEUE_FILE "OA$TEMP:QUEUES.TMP"
	FOR GROUP$MASTER WITH .NAME:4 == "MNG$" DO -
	   TEXT_FILE WRITE QUEUE_FILE .NAME
	TEXT_FILE CLOSE QUEUE_FILE
	DUMP_CACHE

!	Reopen the file for read access
	TEXT_FILE OPEN/READ QUEUE_FILE "OA$TEMP:QUEUES.TMP"

.LABEL DO_QUEUE	
!	Loop down through the file and get details for each queue
	TEXT_FILE READ QUEUE_FILE #QUEUE_REC
	.IF OA$STATUS EQ 0 THEN .GOTO ALL_QUEUES_RESTORED

	GET #MNG_QUEUE_ID = "*" #QUEUE_REC

!	Decide whether we have to deal with a particular queue or all queues

	.IF #MNG_QUEUE_ID EQS #MNG_Q_ALL_ID -
	  THEN -
	    .GOTO RESTORE_ALL_QUEUES -
	  ELSE -
	    .GOTO RESTORE_INDIVIDUAL_QUEUE

.LABEL RESTORE_ALL_QUEUES
!	Code to restore an identifier on all queues

	GET OA$DISPLAY = "Resetting group for all queues . . . " \FORCE
	FOR QUI$QUEUE DO -
	    GET #QUEUE_NAME = .%KEY \\-
	    ACL ADD #QUEUE_TYPE, #QUEUE_NAME, #MNG_QUEUE_ID, #QUEUE_ACCESS

	.GOTO DO_QUEUE

.LABEL RESTORE_INDIVIDUAL_QUEUE
!	Get the queue name and set up the correct group name, then call
!	ACL ADD to add the identifier

	GET #QUEUE_NAME = $NEXT_LIST_ITEM:30:7
	GET #MNG_QUEUE_ID = "*" $NEXT_LIST_ITEM

	GET OA$DISPLAY = "Resetting identifier on queue " #QUEUE_NAME \FORCE

	ACL ADD #QUEUE_TYPE, #QUEUE_NAME, #MNG_QUEUE_ID, #QUEUE_ACCESS
	.GOTO DO_QUEUE

.LABEL ALL_QUEUES_RESTORED

	TEXT_FILE CLOSE QUEUE_FILE
	DELETE_FILE OA$TEMP:QUEUES.TMP
	DISPLAY Queue ACLs restored successfully
	.EXIT

.LABEL ABORT
!	Generic get-out point

	DISPLAY Queue ACLs not restored
	.EXIT
!
! Author: Tony Redmond 
!
! Modified by: 		 | Date:                | Reason:
!-----------------------------------------------------------------------------
! Tony Redmond           | 07-Dec-1992 06:29pm  | Element created, please state
!                        |                      | modifications down here

    
T.RTitleUserPersonal
Name
DateLines