$CHKPRO, or Check Access Protection, is a system service that determines whether an accessor with the specified rights and privileges can access an object with the specified attributes. The service invokes the system’s access protection check, which permits layered products and other subsystems to build protected structures that are consistent with the protection facilities provided by the base operating system. The service also allows a privileged subsystem to perform protection checks on behalf of a requester.
The caller can also request that an object access audit be performed if security auditing has been enabled for the object class or if auditing ACEs are contained in the object’s ACL. The CHP$V_AUDIT flag requests an access audit. This requires that the caller be in executive or kernel mode or possess the AUDIT privilege.
Usually, $CHKPRO generates an object access audit when an audit is required. The caller can specify the CHP$V_CREATE flag to force an object creation audit instead of an object access audit. Similarly, the CHP$V_DELETE flag forces an object deletion audit. The CHP$_AUDIT_LIST item code can be used to specify additional information to be included in any resulting audit records.
- 1 Syntax
- 1.1 itemlst
- 1.1.1 item codes
- 126.96.36.199 CHP$_ACCESS
- 188.8.131.52 CHP$_ACL
- 184.108.40.206 CHP$_ACMODE
- 220.127.116.11 CHP$_ADDRIGHTS
- 18.104.22.168 CHP$_ALARMNAME
- 22.214.171.124 CHP$_AUDIT_LIST
- 126.96.36.199 CHP$_AUDITNAME
- 188.8.131.52 CHP$_FLAGS
- 184.108.40.206 CHP$_MATCHEDACE
- 220.127.116.11 CHP$_MODE
- 18.104.22.168 CHP$_MODES
- 22.214.171.124 CHP$_OBJECT_CLASS
- 126.96.36.199 CHP$_OBJECT_NAME
- 188.8.131.52 CHP$_OWNER
- 184.108.40.206 CHP$_PRIV
- 220.127.116.11 CHP$_PROT
- 18.104.22.168 CHP$_RIGHTS
- 22.214.171.124 CHP$_UIC
- 1.1.1 item codes
- 1.2 objpro
- 1.3 usrpro
- 1.1 itemlst
- 2 Values Returned
- 3 Privileges Required
- 4 See also
SYS$CHKPRO itmlst ,[objpro] ,[usrpro]
int sys$chkpro (void *itmlst, void *objpro, void *usrpro);
Protection attributes of the object and the rights and privileges of the accessor. The item list arguments accepted by this service permit you to specify the protection of the object being accessed, the rights and privileges of the accessor, and the type of access desired. At a minimum, the following item codes should be specified to perform a thirdparty protection check:
The following table defines the item descriptor fields:
|Buffer length||A word containing a user-supplied integer specifying the length (in bytes) of the associated buffer. The length of the buffer needed depends on the item code specified in the item code field of the item descriptor. If the value of buffer length is too small, the service truncates the data.|
|Item code||A word containing a user-supplied symbolic code specifying the item of information in n in the associated buffer. The item codes are defined in the $ACLDEF system macro library.|
|Buffer address||A longword containing the user-supplied address of the buffer.|
|Return length address||A longword that normally contains the user-supplied address of a word in which the service writes the length in bytes of the information it returned. This is not used by $CHKPRO and should contain a 0.|
Specifying any specific protection attribute causes that protection check to be made; any protection attribute not specified is not checked. Rights and privileges specified are used as needed. If a protection check requires any right or privilege not specified in the item list, the right or privilege of the caller’s process is used.
A longword bit mask representing the type of access desired ($ARMDEF). Be aware that the $CHKPRO service does not interpret the bits in the access mask; instead, it compares them to the object’s protection mask (CHP$_PROT). Any bits not specified by CHP$_ACCESS or CHP$_PROT are assumed to be clear, which grants access.
A vector that points to an object’s access control list. The buffer address, bufadr, specifies a buffer containing one or more ACEs. The number that specifies the length of the CHP$_ACL buffer, buflen, must be equal to the sum of all ACE lengths. The format of the ACE structure depends on the value of the second byte in the structure, which specifies the ACE type. The $FORMAT_ACL system service description describes each ACE type and its format. You can specify the CHP$_ACL item multiple times to point to multiple segments of an access control list. You can specify a maximum of 20 segments. The segments are processed in the order specified.
A byte that defines the accessor’s processor access mode. The following access modes and their symbols are defined in the $PSLDEF macro:
If CHP$_ACMODE is not specified, access mode is not used to determine access.
A vector that points to an additional rights list segment to be appended to the existing rights list. Each entry of the rights list is a quadword data structure consisting of a longword containing the identifier value, followed by a longword containing a mask identifying the attributes of the holder. The $CHKPRO service ignores the attributes. A maximum of 11 rights descriptors is allowed. If you specify CHP$_ADDRIGHTS without specifying CHP$_RIGHTS, the accessor’s rights list consists of the rights list specified by the CHP$_ADDRIGHTS item codes and the rights list of the current process. If you specify CHP$_RIGHTS and CHP$_ADDRIGHTS, you should be aware of the following:
- CHP$_RIGHTS must come first.
- The accessor’s UIC is the identifier of the first entry in the rights list specified by the CHP$_RIGHTS item code.
- The accessor’s rights list consists of the rights list specified by the CHP$_RIGHTS item code and the CHP$_ADDRIGHTS item codes.
Address of a buffer to receive the alarm name from any Alarm ACE contained in the object’s ACL. If the object does not have security alarms enabled, $CHKPRO returns retlenadr as 0. If a matching Alarm ACE exists, the string SECURITY will be returned.
A security auditing item list containing additional information to be included in any resulting security audit. The bufadr argument points to the beginning of an $AUDIT_EVENT item list. See the itmlst argument of the $AUDIT_EVENT system service for a list of valid security auditing item codes. Note that the NSA$_EVENT_TYPE and NSA$_EVENT_SUBTYPE items are ignored when auditing with $CHKPRO. The CHP$V_AUDIT flag must be specified.
Address of a buffer to receive the audit name from any Audit ACE contained in the object’s ACL. If the object does not have auditing enabled, $CHKPRO returns retlenadr as 0. If a matching Audit ACE exists, the string SECURITY will be returned.
A longword that defines various aspects of the protection check. The symbols in the following table are offsets to the bits within the longword. You can also obtain the values as masks with the appropriate bit set by using the prefix CHP$M rather than CHP$V. The following symbols are defined only in the system macro library ($CHPDEF):
|CHP$V_ALTER||Accessor desires write access to object.|
|CHP$V_AUDIT||Access audit requested.|
|CHP$V_CREATE||Perform the audit as an object creation event.|
|CHP$V_DELETE||Perform the audit as an object deletion event.|
|CHP$V_FLUSH||Force audit buffer flush.|
|CHP$V_INTERNAL||Audit on behalf of the Trusted Computing Base (TCB). Reserved to VSI.|
|CHP$V_MANDATORY||Force the object access event to be audited.|
|CHP$V_NOFAILAUD||Do not perform audits for failed access.|
|CHP$V_NOSUCCAUD||Do not perform audits for successful access.|
|CHP$V_OBSERVE||Accessor desires read access to object.|
|CHP$V_SERVER||Audit on behalf of a TCB server process.|
|CHP$V_USEREADALL||Accessor is eligible for READALL privilege.|
The default for CHP$_FLAG is CHP$M_OBSERVE and CHP$M_ALTER. The primary purpose of the CHP$V_OBSERVE and CHP$V_ALTER flags is as latent support for a mandatory (lattice) security policy, such as that provided by the Security Enhanced VMS (SEVMS) offering.
This output item is a variable-length data structure containing the first Identifier ACE in the object’s ACL that allowed or denied the accessor to access the object. See the $FORMAT_ACL system service for a description of an Identifier ACE format.
A byte that defines the object’s owner access mode. The following access modes of the object’s owner and their symbols are defined in the system macro library ($PSLDEF):
A quadword that defines the object’s access mode protection. You specify a 2-bit access mode as shown in CHP$_MODE for each possible access type. See OpenVMS System Services Reference Manual Vol. I (A-GETUAI) for the diagram illustrating the format of an access mode vector for bit numbers.
A character string containing the protected object class associated with the object. The object class string is used to determine whether any security auditing is enabled for the object access event. This item code is required when the CHP$_AUDIT flag is specified.
A character string containing the object name associated with the protection check. The object name string is included in any resulting security audit. If an object name string is not specified, the string ‘‘<not available>’’ is substituted in any security audit for all protected object classes other than FILE. For FILE class audits, it is assumed that the caller has supplied an object name by using the auditing item list (NSA$_OBJECT_NAME).
A longword describing the object’s owner identifier (UIC or general identifier). This might be either a UIC format identifier or a general identifier. Note that CHP$_OWNER is used in conjunction with the CHP$_PROT item code.
A quadword that defines an accessor’s privilege mask. Each bit in the mask has a symbolic name, defined by the $PRVDEF macro. You form the bit array by specifying the symbolic name of each privilege in a logical OR operation. See the $SETPRV system service for the symbolic name and description of each privilege.
CHP$_PRIVUSED A longword mask of flags representing privileges used to gain the requested access. You can also obtain the values as masks with the appropriate bit set by using the prefix CHP$M rather than CHP$V. The symbols are defined in the system macro library ($CHPDEF). The following symbols are used as offsets to the bits within the longword:
|CHP$V_SYSPRV||SYSPRV was used to gain the requested access.|
|CHP$V_GRPPRV||GRPPRV was used to gain the requested access.|
|CHP$V_BYPASS||BYPASS was used to gain the requested access.|
|CHP$V_READALL||READALL was used to gain the requested access.|
|CHP$V_OPER||OPER was used to gain the requested access.|
|CHP$V_GRPNAM||GRPNAM was used to gain the requested access.|
|CHP$V_SYSNAM||SYSNAM was used to gain the requested access.|
|CHP$V_GROUP||GROUP was used to gain the requested access.|
|CHP$V_WORLD||WORLD was used to gain the requested access.|
|CHP$V_PRMCEB||PRMCEB was used to gain the requested access.|
|CHP$V_UPGRADE||UPGRADE was used to gain the requested access.|
|CHP$V_DOWNGRADE||DOWNGRADE was used to gain the requested access.|
A vector describing the object’s SOGW protection mask. See OpenVMS System Services Reference Manual Vol. I (A-GETUAI) for the diagram depicting the format for describing the object's protection.
The $CHKPRO service compares the low-order four bits of CHP$_ACCESS against one of the 4-bit fields in the low-order word of CHP$_PROT, the next four bits of CHP$_ACCESS against one of the 4-bit fields in the next word of CHP$_PROT, and so on. The $CHKPRO service chooses a field of CHP$_PROT based on the privileges specified for the accessor (CHP$_PRIV), the UICs of the accessor (CHP$_RIGHTS or CHP$_ADDRIGHTS, or both), and the object’s owner (CHP$_OWNER).
You must also specify the identifier of the object’s owner with CHP$_OWNER when you use CHP$_PROT.
A vector that points to an accessor’s rights list. The accessor’s UIC is the identifier of the first entry in the rights list. The accessor’s rights list consists of the rights list specified by CHP$_RIGHTS and, optionally, the rights list specified by the CHP$_ADDRIGHTS item codes.
A longword specifying the accessor’s owner UIC. This item code can be used to avoid having to pass an entire rights list segment via the CHP$_RIGHTS item code. If CHP$_RIGHTS and then CHP$_UIC are specified, in that order, $CHKPRO initializes the local rights list and then replaces just the owner UIC with the value of CHP$_UIC.
|Type:||opaque byte stream|
Buffer containing an object security profile. The objpro argument is the address of a descriptor pointing to a buffer that contains an encoded object security profile. The objpro argument eliminates the need to supply all of the component object protection attributes with the $CHKPRO item list. The objpro argument is currently reserved to VSI.
|Type:||opaque byte stream|
Buffer containing a user security profile. The usrpro argument is the address of a descriptor pointing to a buffer that contains an encoded user security profile. The usrpro argument eliminates the need to supply all of the component user security attributes with the $CHKPRO item list. The $CREATE_USER_PROFILE service can be used to construct a user security profile. When the usrpro argument is specified, any component user profile attributes specified in the $CHKPRO item list replace those contained in the user security profile. The item codes used with $CHKPRO are described in the following list and are defined in the $CHPDEF system macro library
|SS$_NORMAL||The service completed successfully; the desired access is granted.|
|SS$_ACCVIO||The item list cannot be read by the caller, or one of the buffers specified in the item list cannot be written by the caller.|
|SS$_ACLFULL||More than 20 CHP$_ACL items were given.|
|SS$_BADPARAM||The argument is invalid.|
|SS$_BUFFEROVF||The output buffer is too small and the protection check succeeded.|
|SS$_IVACL||You supplied an invalid ACL segment with the CHP$_ACL item.|
|SS$_IVBUFLEN||The output buffer is too small and the protection check failed.|
|SS$_NOAUDIT||Caller lacks privilege to request audit.|
|SS$_NOPRIV||The desired access is not granted.|
|SS$_RIGHTSFULL More than 11 CHP$_ADDRIGHTS items were given.|
AUDIT privilege is required when requesting an audit.