[an error occurred while processing this directive]
HP OpenVMS Systems Documentation |
HP OpenVMS System Services Reference Manual
Queue Protection
This section describes UIC-based protection checking that is performed by the $SNDJBC service to control access to queues. As an alternative to this form of protection checking, you can associate ACLs with queues using the appropriate security services. See the $GET_SECURITY and $SET_SECURITY system services for more information. There are two aspects to UIC-based queue protection:
In addition, certain queue operations require the caller of $SNDJBC to have certain privileges. The function codes that require privileges are listed in the Privileges and Restrictions section. When a job is submitted to a queue, it is assigned a UIC that is the same as the UIC of the process submitting the job, unless the SJC$_UIC item code is specified to supply a different UIC. For each requested operation, the $SNDJBC service checks the UIC and privileges of the requesting process against the UIC of the queue, protection specified for the queue, and the privileges, if any, required for the operation. This checking is performed in a way similar to the way that the file system checks access to a file by comparing the owner UIC and protection of the file with the UIC and privileges of the requester. Operations that apply to jobs are checked against read and delete protection specified for the queue in which the job is entered and the owner UIC of the job. In general, read access to a job allows you to determine that the job exists; delete access to a job allows you to affect the job. Operations that apply to queues are checked against the submit and manage protection specified for the queue and the owner UIC of the queue. In general, submit access to a queue allows you to submit jobs to the queue; manage access to a queue allows you to act as an operator for the queue, including the ability to affect jobs in the queue, to affect accounting, and to alter queues. OPER privilege grants manage access to all queues. To specify the following function codes, the caller must have both OPER and SYSNAM privilege: SJC$_DELETE_QUEUE_MANAGER To specify the following function codes, the caller must have OPER privilege: SJC$_CREATE_QUEUE To specify the following function code, the caller can have OPER privilege or manage access: SJC$_DELETE_QUEUE To specify the following function code, the caller must have OPER privilege, execute access to the queue containing the specified job, or read access to the specified job: SJC$_SYNCHRONIZE_JOB To specify the following function codes, the caller must have OPER privilege, manage access to the specified queue, or submit access to the specified queue: SJC$_ADD_FILE To specify the following function codes, the caller must have OPER privilege or manage access to the specified queue or queues: SJC$_ALTER_QUEUE To specify the following function codes, the caller must have OPER privilege, manage access to the queue containing the specified job, or delete access to the specified job: SJC$_ABORT_JOB To specify the following function codes, no privilege is required: SJC$_BATCH_CHECKPOINT To specify a scheduling priority (using the SJC$_PRIORITY item code) higher than the value of the system parameter MAXQUEPRI, the caller needs OPER or ALTPRI privilege. To specify the following item codes, the caller must have OPER privilege: SJC$_OWNER_UIC To specify the following item codes, the caller must have CMKRNL privilege: SJC$_ACCOUNT_NAME To specify the astadr argument, the process must have sufficient ASTLM quota. $ALLOC, $ASSIGN, $BRKTHRU, $BRKTHRUW, $CANCEL, $CREMBX, $DALLOC, $DASSGN, $DELMBX, $DEVICE_SCAN, $DISMOU, $GETDVI, $GETDVIW, $GETMSG, $GETQUI, $GETQUIW, $INIT_VOL, $MOUNT, $PUTMSG, $QIO, $QIOW, $SNDERR, $SNDJBCW, $SNDOPR, $TRNLNM Condition Values Returned
Condition Values Returned in the I/O Status Block
When you use the SJC$_SYNCHRONIZE_JOB function code, the return value is the exit status of the specified job. When you start a symbiont queue with the SJC$_START_QUEUE function code or the SJC$_CREATE_QUEUE function code with the SJC$_CREATE_START item code, any error encountered by the symbiont process will be returned in the IOSB.
|
#1 |
---|
$ vfyold = f$verify(1) $ create sys$scratch:accounting.c #include <efndef.h> #include <lib$routines.h> #include <sjcdef.h> #include <ssdef.h> #include <starlet.h> #include <stddef.h> #include <stsdef.h> struct ItemList3 { short int ItemLength; short int ItemCode; void *ItemBuffer; void *ItemRetLen; }; #define MAXITMLST 3 main() { int i; struct ItemList3 JbcIL[MAXITMLST]; unsigned short int IOSB[4]; int RetStat, JbcMask, JbcFunc; /* To start accounting: */ JbcFunc = SJC$_START_ACCOUNTING; /* Specify image and interactive */ JbcMask = SJC$M_ACCT_IMAGE | SJC$M_ACCT_INTERACTIVE; i = 0; JbcIL[i].ItemLength = sizeof( JbcMask ); JbcIL[i].ItemCode = SJC$_ACCOUNTING_TYPES; JbcIL[i].ItemBuffer = (void *) &JbcMask; JbcIL[i++].ItemRetLen = NULL; JbcIL[i].ItemLength = 0; JbcIL[i].ItemCode = 0; JbcIL[i].ItemBuffer = NULL; JbcIL[i++].ItemRetLen = NULL; RetStat = sys$sndjbcw(EFN$C_ENF,JbcFunc,0, JbcIL,IOSB,0,0); if (!$VMS_STATUS_SUCCESS( RetStat )) lib$signal( RetStat ); if (!$VMS_STATUS_SUCCESS( IOSB[0] )) lib$signal( IOSB[0] ); return SS$_NORMAL; } $ cc/decc/prefix=all sys$scratch:accounting.c/object=sys$scratch: $ link/executable=sys$scratch:accounting.exe sys$scratch:accounting $ show accounting $ prvold = f$setprv("OPER") $ run sys$scratch:accounting $ show accounting $ priv = f$setprv(prvold) $ vfyold = f$verify(vfyold) $ exit |
This C program demonstrates an $SNDJBCW call.
#2 |
---|
! Declare system service related symbols INTEGER*4 SYS$SNDJBCW, 2 STATUS INCLUDE '($SJCDEF)' ! Define item list structure STRUCTURE /ITMLST/ UNION MAP INTEGER*2 BUFLEN, ITMCOD INTEGER*4 BUFADR, RETADR END MAP MAP INTEGER*4 END_LIST END MAP END UNION END STRUCTURE ! Define I/O status block structure STRUCTURE /IOSBLK/ INTEGER*4 STS, ZEROED END STRUCTURE ! Declare $SNDJBCW item list and I/O status block RECORD /ITMLST/ SUBMIT_LIST(6) RECORD /IOSBLK/ IOSB ! Declare variables used in $SNDJBCW item list CHARACTER*9 QUEUE /'SYS$BATCH'/ CHARACTER*23 FILE_SPECIFICATION /'$DISK1:[COMMON]TEST.COM'/ CHARACTER*12 USERNAME /'PROJ3036 '/ INTEGER*4 ENTRY_NUMBER ! Initialize item list for the enter file operation SUBMIT_LIST(1).BUFLEN = 9 SUBMIT_LIST(1).ITMCOD = SJC$_QUEUE SUBMIT_LIST(1).BUFADR = %LOC(QUEUE) SUBMIT_LIST(1).RETADR = 0 SUBMIT_LIST(2).BUFLEN = 23 SUBMIT_LIST(2).ITMCOD = SJC$_FILE_SPECIFICATION SUBMIT_LIST(2).BUFADR = %LOC(FILE_SPECIFICATION) SUBMIT_LIST(2).RETADR = 0 SUBMIT_LIST(3).BUFLEN = 12 SUBMIT_LIST(3).ITMCOD = SJC$_USERNAME SUBMIT_LIST(3).BUFADR = %LOC(USERNAME) SUBMIT_LIST(3).RETADR = 0 SUBMIT_LIST(4).BUFLEN = 0 SUBMIT_LIST(4).ITMCOD = SJC$_NO_LOG_SPECIFICATION SUBMIT_LIST(4).BUFADR = 0 SUBMIT_LIST(4).RETADR = 0 SUBMIT_LIST(5).BUFLEN = 4 SUBMIT_LIST(5).ITMCOD = SJC$_ENTRY_NUMBER_OUTPUT SUBMIT_LIST(5).BUFADR = %LOC(ENTRY_NUMBER) SUBMIT_LIST(5).RETADR = 0 SUBMIT_LIST(6).END_LIST = 0 ! Call $SNDJBCW service to submit the batch job STATUS = SYS$SNDJBCW (, 2 %VAL(SJC$_ENTER_FILE),, 2 SUBMIT_LIST, 2 IOSB,,) IF (STATUS) STATUS = IOSB.STS IF (.NOT. STATUS) CALL LIB$SIGNAL (%VAL(STATUS)) END |
This Fortran program demonstrates the use of the $SNDJBCW service to submit a batch job that is to execute on behalf of another user. No log file is produced for the batch job. This program saves the job's entry number. You need CMKRNL privilege to run this program.
The Send to Job Controller and Wait and $GETQUI services together provide the user interface to the Job Controller (JBC) facility. The $SNDJBCW service allows you to create, stop, and manage queues and the jobs in those queues. Queues can be generic, batch, execution, or output queues. Jobs can be batch or print jobs.The $SNDJBCW service queues a request to the job controller. For most operations, $SNDJBCW completes synchronously; that is, it returns to the caller after the operation completes; however, if the requested operation is a pause queue, stop queue, or abort job operation, $SNDJBCW returns to the caller after queuing the request. There is no way to synchronize completion of these operations. Also, $SNDJBCW does not wait for a job to complete before it returns to the caller. To synchronize completion of a job, the caller must specify the SJC$_SYNCHRONIZE_JOB function code.
The $SNDJBCW service is identical to the Send to Job Controller ($SNDJBC) service except that $SNDJBC completes asynchronously; the $SNDJBC service returns to the caller immediately after queuing the request, without waiting for the operation to complete.
For additional information about $SNDJBCW, refer to the documentation of $SNDJBC.
The $SNDJBC and $SNDJBCW services supersede the Send Message to Symbiont Manager ($SNDSMB) and Send Message to Accounting Manager ($SNDACC) services. You should write new programs using $SNDJBC or $SNDJBCW, instead of $SNDSMB or $SNDACC. You should convert old programs using $SNDSMB or $SNDACC to use $SNDJBC or $SNDJBCW, as convenient.
SYS$SNDJBCW [efn] ,func [,nullarg] [,itmlst] [,iosb] [,astadr] [,astprm]
int sys$sndjbcw (unsigned int efn, unsigned short int func, unsigned int nullarg, void *itmlst, struct _iosb *iosb, void (*astadr)(__unknown_params), int astprm);
Performs the following functions:
- Sends a user request to operator terminals
- Sends a user cancellation request to operator terminals
- Sends an operator reply to a user terminal
- Enables an operator terminal
- Displays the status of an operator terminal
- Initializes the operator log file
SYS$SNDOPR msgbuf ,[chan]
int sys$sndopr (void *msgbuf, unsigned short int chan);
msgbuf
OpenVMS usage: char_string type: character-coded text string access: read only mechanism: by descriptor--fixed-length string descriptor
User buffer specifying the operation to be performed and the information needed to perform that operation. The msgbuf argument is the address of a character string descriptor pointing to the buffer.The format and contents of the buffer vary with the requested operation; however, the first byte in any buffer is the request code, which specifies the operation to be performed. The $OPCMSG macro defines the symbolic names for these request codes.
The following table shows each operation that $SNDOPR performs and the request code that specifies that operation:
Request Code Corresponding Operation OPC$_RQ_CANCEL Sends a user cancellation request to specified operator terminals. You use this request code to notify one or more operators that a previous request is to be canceled. To specify OPC$_RQ_CANCEL, you must also specify the chan argument. OPC$_RQ_LOGI Initializes the operator log file. OPC$_RQ_REPLY Sends an operator reply to a user who has made a request. Operators use this request code to report the status of a user request. The format of the message buffer for this request is the format of the reply found in the user's mailbox after the call to $SNDOPR completes. All functions of $SNDOPR that deliver a reply to a mailbox do so in the format described for this request code. OPC$_RQ_RQST Sends a user request to operator terminals. This request code is used to make an operator request. If you specify a reply to the request (by using the chan argument), the operator request is kept active until the operator responds. OPC$_RQ_STATUS Reports the status of an operator terminal. Operators use this request to display the operator classes for which the specified terminal is enabled and a list of outstanding requests. OPC$_RQ_TERME Enables an operator terminal. You use this request to enable a specified terminal to receive operator messages. The following diagrams depict the message buffer for each of these request codes. Each field within a diagram has a symbolic name, which serves to identify the field; in other words, these names specify offsets into the message buffer. The list following each diagram shows each field name and what its contents can or should be. The $OPCDEF macro defines the field names, as well as any other symbolic name that can be specified as the contents of a field.
OPC$B_MS_TYPE | This 1-byte field contains the request code OPC$_RQ_RQST. | ||||||||||||||||||||
OPC$Z_MS_TARGET_CLASSES |
This 3-byte field contains a 24-bit bit vector that specifies which
operator terminal types are to receive the request. The $OPCDEF macro
defines symbolic names for the operator terminal types. You construct
the bit vector by specifying the desired symbolic names in a logical OR
operation. Following is the symbolic name of each operator terminal
type:
|
||||||||||||||||||||
OPC$L_MS_RQSTID | This longword field contains a user-supplied longword message code. | ||||||||||||||||||||
OPC$L_MS_TEXT | This variable-length field contains an ASCII string specifying text to be sent to the specified operator terminals. $SNDOPR uses the buffer size of the device to which the message is being sent. |
Previous | Next | Contents | Index |