Using the content of XAPLDIAG
The RACF access control module returns a parameter, XAPLDIAG, that Db2 and other licensed programs can use to trap and obtain diagnostic information.
When the RACF access control module issues the RACROUTE REQUEST=FASTAUTH macro for authorization checking, depending on the AUDIT options used with the check, the module can record the resulting SAF return code, RACF return code, and RACF reason code in XAPLDIAG. Each invocation of the RACF access control module can issue multiple RACROUTE REQUEST=FASTAUTH macros, but the module evaluates each return code generated and determines the single correct return code to send to Db2.
The RACF access control module can store up to 20 sets of return codes from RACROUTE REQUEST=FASTAUTH macros in XAPLDIAG, allowing the results of a specific RACROUTE REQUEST=FASTAUTH macro to be determined.
The XAPL parameter list can be captured using Db2 trace record IFCID 314. In addition, the return code and corresponding reason code (EXPLRC1 and EXPLRC2) for authorization failures are captured in Db2 trace record IFCID 140.
The content of XAPLDIAG depends on the return code and reason code from the RACF access control module. The return and reason codes in XAPLDIAG are in the same order as the checks that are described in the rules table for each privilege. You can use this order to determine which checks failed and which checks granted access.
- If EXPLRC1=4 and ECPLRC2=14 (decimal), the ALESERV failed and the module made no RACROUTE REQUEST=FASTAUTH checks. In this case the first word of XAPLDIAG contains the non-zero ALESERV return code.
- Otherwise, each word of XAPLDIAG can contain a SAF return code, RACF return code, and RACF reason code corresponding to a non-zero return code from a RACROUTE REQUEST=FASTAUTH macro. Information related to non-zero return codes is stored in XAPLDIAG beginning with the first word until information related to all non-zero return codes has been stored, or until the XAPLDIAG area has filled. XAPLDIAG contains 20 words, allowing information related to 20 FASTAUTH requests to be stored for an invocation of the RACF access control module. If more than 20 FASTAUTH requests are issued, only the first 20 sets of return codes are stored.
- Y
- Access to the database is allowed.
- N
- Access to the database is not allowed.
- U
- RACF was unable to return a decision. This occurs when the FASTAUTH request returns a SAF return code of X'04'.
XAPLDBNP DS F PTR TO NEXT DATABASE INFORMATION STRUC
XAPLDBNM DS CL8 DATABASE NAME
XAPLDBDA DS CL1 'Y' - IS DBADM
XAPLDBIM DS CL1 'Y' - IS AN IMPLICIT DATABASE
XAPLRSV5 DS CL2 RESERVED - UNUSED Although DBADM checks can be done for multiple databases, only the results of the first 20 FASTAUTH requests are stored in XAPLDIAG. The results of all DBADM checking for each database is contained in the XAPL parameter list and is available using Db2 trace record IFCID 314.
xxyyzzzz where:
xx- is the 1-byte SAF return code
yy- is the 1-byte RACF return code
zzzz- is the 2-byte RACF reason code