/**/ /***************************************************************************/ /** **/ /** © Copyright 2010, Hewlett-Packard Development Company, L.P. **/ /** **/ /** Confidential computer software. Valid license from HP and/or **/ /** its subsidiaries required for possession, use, or copying. **/ /** **/ /** Consistent with FAR 12.211 and 12.212, Commercial Computer Software, **/ /** Computer Software Documentation, and Technical Data for Commercial **/ /** Items are licensed to the U.S. Government under vendor's standard **/ /** commercial license. **/ /** **/ /** Neither HP nor any of its subsidiaries shall be liable for technical **/ /** or editorial errors or omissions contained herein. The information **/ /** in this document is provided "as is" without warranty of any kind and **/ /** is subject to change without notice. The warranties for HP products **/ /** are set forth in the express limited warranty statements accompanying **/ /** such products. Nothing herein should be construed as constituting an **/ /** additional warranty. **/ /** **/ /***************************************************************************/ /********************************************************************************************************************************/ /* Created: 30-Mar-2010 17:27:02 by OpenVMS SDL EV3-3 */ /* Source: 31-AUG-2004 10:26:26 $1$DGA7274:[LIB_H.SRC]PSBDEF.SDL;1 */ /********************************************************************************************************************************/ /*** MODULE $PSBDEF ***/ #ifndef __PSBDEF_LOADED #define __PSBDEF_LOADED 1 #pragma __nostandard /* This file uses non-ANSI-Standard features */ #pragma __member_alignment __save #pragma __nomember_alignment #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __save /* Save the previously-defined required ptr size */ #pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */ #endif #ifdef __cplusplus extern "C" { #define __unknown_params ... #define __optional_params ... #else #define __unknown_params #define __optional_params ... #endif #ifndef __struct #if !defined(__VAXC) #define __struct struct #else #define __struct variant_struct #endif #endif #ifndef __union #if !defined(__VAXC) #define __union union #else #define __union variant_union #endif #endif #include /* Define the prvdef type */ /* */ /* The following constants apply to members of the PSB structure */ /* */ #define PSB$K_SIZE_ACCOUNT 32 /* */ #define PSB$K_SIZE_USERNAME 32 /* */ #define PSB$K_COUNT_PERSONAE 8 /* */ #define PSB$K_COUNT_RIGHTS 10 /* */ /* */ /* The following constants apply to members of the PSB structure */ /* PSB$AR_RIGHTS and PSB$AR_AUTHRIGHTS and should match their bitwise */ /* counterparts. */ /* */ /* NOTE : Any changes to the constants here must be reflected in */ /* bitfields in the RIGHTS_ENABLED field. */ /* */ #define PSB$K_RIGHTS_PERSONA 0 #define PSB$K_RIGHTS_SYSTEM 1 #define PSB$K_RIGHTS_INSTALLED 2 #define PSB$K_RIGHTS_SUBSYSTEM 3 #define PSB$K_RIGHTS_TEMPORARY 4 #define PSB$K_RIGHTS_CHKPRO 9 /* */ /* Persona Security Block definitions */ /* */ #define PSB$M_PERMANENT 0x1 #define PSB$M_SECAUDIT 0x2 #define PSB$M_CLONE 0x8 #define PSB$M_RMS 0x10 #define PSB$M_IO 0x20 #define PSB$M_TCB 0x40 #define PSB$M_DEBIT 0x80 #define PSB$M_RESERVE 0x100 #define PSB$M_DELEGATE 0x200 #define PSB$M_CREATE_USER 0x400 #define PSB$M_CREATE_TLV 0x800 #define PSB$M_CREATE_ITMLST 0x1000 #define PSB$K_FLAGS_BIT_COUNT 13 /* Number of flags */ #define PSB$M_DELETE_PENDING 0x20000000 #define PSB$M_DP_PROCESSING 0x40000000 #define PSB$M_DEALLOCATED 0x80000000 #define PSB$K_RESERVE_PERSONA_LENGTH 56 #define PSB$M_PERSONA 0x1 #define PSB$M_SYSTEM 0x2 #define PSB$M_INSTALLED 0x4 #define PSB$M_SUBSYSTEM 0x8 #define PSB$M_TEMPORARY 0x10 #define PSB$M_CHKPRO 0x200 #define PSB$K_CLONE_REGION_SIZE 228 #ifdef __cplusplus /* Define structure prototypes */ struct _rights; struct _class; #endif /* #ifdef __cplusplus */ #if !defined(__NOBASEALIGN_SUPPORT) && !defined(__cplusplus) /* If using pre DECC V4.0 or C++ */ #pragma __nomember_alignment __quadword #else #pragma __nomember_alignment #endif typedef struct _psb { #pragma __nomember_alignment struct _psb *psb$l_flink; /* Standard listhead forward link */ struct _psb *psb$l_blink; /* Standard listhead backward link */ unsigned short int psb$w_size; /* Standard structure size, in bytes */ unsigned char psb$b_type; /* Standard type code for PSB (DYN$C_SECURITY) */ unsigned char psb$b_subtype; /* Standard subtype code (DYN$C_SECURITY_PSB) */ __union { unsigned int psb$l_debug_data_1; /* First of 2 debug data cells */ struct _psb *psb$l_debug_flink; /* Forward link to previous PSB (DEBUG) */ } psb$r_debug_1_overlay; __union { unsigned int psb$l_debug_data_2; /* Second of 2 debug data cells */ struct _psb *psb$l_debug_blink; /* Backward link to previous PSB (DEBUG) */ } psb$r_debug_2_overlay; unsigned int psb$l_debug_pid; /* PID of process that allocated this PSB (DEBUG) */ __union { unsigned int psb$l_flags; /* Every structure needs a set of flags :-) */ __struct { unsigned psb$v_permanent : 1; /* This PSB is permanent */ unsigned psb$v_secaudit : 1; /* Security audit Mandatory */ unsigned psb$v_fill_2 : 1; /* available for reuse (old DELETE_PENDING location) */ unsigned psb$v_clone : 1; /* PSB created via Clone operation. */ unsigned psb$v_rms : 1; /* PSB created in RMS */ unsigned psb$v_io : 1; /* PSB created in IO */ unsigned psb$v_tcb : 1; /* This PSB is part of the TCB */ unsigned psb$v_debit : 1; /* Debit BYTLM/BYTCNT for this structure */ unsigned psb$v_reserve : 1; /* Dummy PSB ("Runt") to hold persona index in server */ unsigned psb$v_delegate : 1; /* PSB created via Delegate operation */ unsigned psb$v_create_user : 1; /* PSB created via $PERSONA_CREATE with username parameter */ unsigned psb$v_create_tlv : 1; /* PSB created via $PERSONA_CREATE with profile (tlv) parameter */ unsigned psb$v_create_itmlst : 1; /* PSB created via $PERSONA_CREATE with itemlist parameter */ unsigned psb$v_flags_rsvd : 16; unsigned psb$v_delete_pending : 1; /* Request for persona delete pending ... */ unsigned psb$v_dp_processing : 1; /* PSB in process od DELETE_PENDING processing */ unsigned psb$v_deallocated : 1; /* PSB has been deallocated (pool monitoring) */ } psb$r_fill_1_; } psb$r_fill_0_; unsigned int psb$l_persona_id; /* Persona id assigned to this PSB */ unsigned int psb$l_refcount; /* Number of attached execution contexts to this PSB */ unsigned int psb$o_uid [4]; /* Universal identifier assigned to persona */ #if defined(__VAXC) char psb$t_clone_region[]; #else #define psb$t_clone_region psb$l_mode #endif /* #if defined(__VAXC) */ unsigned int psb$l_mode; /* Access level for this PSB (User,Supervisor,Exec,Kernel) */ /* End of the reserve PSB (runt). */ char psb$t_username [32]; /* Persona Username */ char psb$t_account [32]; /* Persona Account name */ unsigned int psb$l_noaudit; /* Non-zero implies no audit status */ __union { unsigned int psb$l_uic; /* UIC of persona */ __struct { unsigned short int psb$w_mem; /* Member number in UIC */ unsigned short int psb$w_grp; /* Group number in UIC */ } psb$r_fill_3_; } psb$r_fill_2_; /* UIC_FLAGS must always follow UIC */ unsigned int psb$l_uic_flags; /* UIC identifier flags longword */ /* (should always be zero) */ unsigned int psb$l_concealed_count; /* Hidden reference tracking */ void *psb$l_off_process_ptr; /* Ptr to off_process ringbuffer */ int psb$l_reserved; /* Used for quadword alignment */ __union { unsigned __int64 psb$q_doi; /* Domain Of Interpretation */ __struct { unsigned int psb$l_doi; unsigned int psb$l_doi_pid; } psb$r_fill_5_; } psb$r_fill_4_; PRVDEF psb$q_authpriv; /* Allowable privileges */ PRVDEF psb$q_permpriv; /* Permanent privileges */ PRVDEF psb$q_workpriv; /* Current working privileges */ PRVDEF psb$q_image_workpriv; /* Image working privileges */ __union { unsigned int psb$l_rights_enabled; /* Bitmap of enabled/disabled rights pointers */ __struct { unsigned psb$v_persona : 1; /* in rights array */ unsigned psb$v_system : 1; /* */ unsigned psb$v_installed : 1; /* */ unsigned psb$v_subsystem : 1; /* */ unsigned psb$v_temporary : 1; /* */ unsigned psb$v_fill_1 : 4; /* */ unsigned psb$v_chkpro : 1; /* Rights slot reserved for CHKPRO processing */ unsigned psb$v_fill_8_ : 6; } psb$r_fill_7_; } psb$r_fill_6_; struct _rights *psb$ar_authrights [10]; /* Array of pointers to authorized rights chains */ struct _rights *psb$ar_rights [10]; /* Array of pointers to active rights chains */ struct _class *psb$ar_class; /* Pointer to classification data block */ unsigned int psb$l_posix_uid; /* POSIX UID field */ unsigned int psb$l_posix_gid; /* POSIX GID field */ unsigned int psb$l_pxb_count; /* Number of extensions registered when this persona is created. */ void *psb$ar_pxb_array; /* Pointer to array of pointers to this PSB's extension blocks. */ unsigned __int64 psb$q_pxb_mutex; /* Mutex to sych access to this PSB's fields. */ } PSB; #if !defined(__VAXC) #define psb$l_debug_data_1 psb$r_debug_1_overlay.psb$l_debug_data_1 #define psb$l_debug_flink psb$r_debug_1_overlay.psb$l_debug_flink #define psb$l_debug_data_2 psb$r_debug_2_overlay.psb$l_debug_data_2 #define psb$l_debug_blink psb$r_debug_2_overlay.psb$l_debug_blink #define psb$l_flags psb$r_fill_0_.psb$l_flags #define psb$v_permanent psb$r_fill_0_.psb$r_fill_1_.psb$v_permanent #define psb$v_secaudit psb$r_fill_0_.psb$r_fill_1_.psb$v_secaudit #define psb$v_clone psb$r_fill_0_.psb$r_fill_1_.psb$v_clone #define psb$v_rms psb$r_fill_0_.psb$r_fill_1_.psb$v_rms #define psb$v_io psb$r_fill_0_.psb$r_fill_1_.psb$v_io #define psb$v_tcb psb$r_fill_0_.psb$r_fill_1_.psb$v_tcb #define psb$v_debit psb$r_fill_0_.psb$r_fill_1_.psb$v_debit #define psb$v_reserve psb$r_fill_0_.psb$r_fill_1_.psb$v_reserve #define psb$v_delegate psb$r_fill_0_.psb$r_fill_1_.psb$v_delegate #define psb$v_create_user psb$r_fill_0_.psb$r_fill_1_.psb$v_create_user #define psb$v_create_tlv psb$r_fill_0_.psb$r_fill_1_.psb$v_create_tlv #define psb$v_create_itmlst psb$r_fill_0_.psb$r_fill_1_.psb$v_create_itmlst #define psb$v_delete_pending psb$r_fill_0_.psb$r_fill_1_.psb$v_delete_pending #define psb$v_dp_processing psb$r_fill_0_.psb$r_fill_1_.psb$v_dp_processing #define psb$v_deallocated psb$r_fill_0_.psb$r_fill_1_.psb$v_deallocated #define psb$l_uic psb$r_fill_2_.psb$l_uic #define psb$w_mem psb$r_fill_2_.psb$r_fill_3_.psb$w_mem #define psb$w_grp psb$r_fill_2_.psb$r_fill_3_.psb$w_grp #define psb$q_doi psb$r_fill_4_.psb$q_doi #define psb$l_doi psb$r_fill_4_.psb$r_fill_5_.psb$l_doi #define psb$l_doi_pid psb$r_fill_4_.psb$r_fill_5_.psb$l_doi_pid #define psb$l_rights_enabled psb$r_fill_6_.psb$l_rights_enabled #define psb$v_persona psb$r_fill_6_.psb$r_fill_7_.psb$v_persona #define psb$v_system psb$r_fill_6_.psb$r_fill_7_.psb$v_system #define psb$v_installed psb$r_fill_6_.psb$r_fill_7_.psb$v_installed #define psb$v_subsystem psb$r_fill_6_.psb$r_fill_7_.psb$v_subsystem #define psb$v_temporary psb$r_fill_6_.psb$r_fill_7_.psb$v_temporary #define psb$v_chkpro psb$r_fill_6_.psb$r_fill_7_.psb$v_chkpro #endif /* #if !defined(__VAXC) */ #define PSB$K_LENGTH 296 /* Length of PSB structure */ #ifdef __cplusplus /* Define structure prototypes */ struct _psa; #endif /* #ifdef __cplusplus */ #if !defined(__NOBASEALIGN_SUPPORT) && !defined(__cplusplus) /* If using pre DECC V4.0 or C++ */ #pragma __nomember_alignment __quadword #else #pragma __nomember_alignment #endif typedef struct _psb_array { #pragma __nomember_alignment struct _psa *psa$l_flink; /* Standard listhead forward link */ struct _psa *psa$l_blink; /* Standard listhead backward link */ unsigned short int psa$w_size; /* Standard structure size, in bytes */ unsigned char psa$b_type; /* Standard type code for PSB (DYN$C_SECURITY) */ unsigned char psa$b_subtype; /* Standard subtype code (DYN$C_SECURITY_PSB) */ int psa$l_reserved; /* Keep array quad aligned ... */ #if defined(__VAXC) char psa$t_elements[]; #else /* Warning: empty char[] member for psa$t_elements at end of structure not created */ #endif /* #if defined(__VAXC) */ } PSB_ARRAY; /* */ /* The following constants are used in TLV conversion of PSB structures */ /* The first 6 items are positioned for backward compatibility the */ /* older CHP$_ item codes and should not be changed. */ /* */ /* The ADD_RIGHTS and ADD_AUTHRIGHTS codes below should not be used. They */ /* are here to be compatible with the item codes found in ISSDEF. */ /* */ /* Any changes to the list below should also be reflected in the */ /* module [STARLET] ISSDEF.SDL */ #define PSB$_TLV_FLAGS 1 /* 1 */ #define PSB$_TLV_ARBFLAGS 2 /* 2 CHP$_FLAGS Placeholder to avoid conflict with ARB TLVs */ #define PSB$_TLV_ARBPRIV 3 /* 3 CHP$_PRIVS Placeholder to avoid conflict with ARB TLVs */ #define PSB$_TLV_MODE 4 /* 4 */ #define PSB$_TLV_WORKCLASS 5 /* 5 */ #define PSB$_TLV_RIGHTS 6 /* 6 */ /* 7 ISS$_ADD_RIGHTS placeholder */ /* 8 ISS$_ADD_AUTHRIGHTS placeholder */ #define PSB$_TLV_USERNAME 9 /* 9 */ #define PSB$_TLV_ACCOUNT 10 /* 10 */ #define PSB$_TLV_NOAUDIT 11 /* 11 */ #define PSB$_TLV_AUTHPRIV 12 /* 12 */ #define PSB$_TLV_PERMPRIV 13 /* 13 */ #define PSB$_TLV_IMAGE_WORKPRIV 14 /* 14 */ #define PSB$_TLV_RIGHTS_ENABLED 15 /* 15 */ #define PSB$_TLV_AUTHRIGHTS 16 /* 16 */ #define PSB$_TLV_MINCLASS 17 /* 17 */ #define PSB$_TLV_MAXCLASS 18 /* 18 */ #define PSB$_TLV_UID 19 /* 19 */ /* 20 */ /* 21 */ #define PSB$_TLV_UIC 22 /* 22 */ #define PSB$_TLV_WORKPRIV 23 /* 23 */ #define PSB$_TLV_POSIX_UID 24 /* 24 */ #define PSB$_TLV_POSIX_GID 25 /* 25 */ #define PSB$_TLV_MIN_CODE 1 #define PSB$_TLV_MAX_CODE 25 /* */ /* The following PSB RingBuffer structure is employed for recording recent persona activity */ /* for a given process. P1 storage is allocated during process creation for */ /* this purpose. */ /* */ /* */ /* */ #define PSBRB$M_CLONE_PSB 0x1 #define PSBRB$M_DEREFERENCE_PSB 0x2 #define PSBRB$M_DELETE_PERSONA 0x4 #define PSBRB$M_FREE_PSB 0x8 #define PSBRB$M_REFERENCE_PSB 0x10 #define PSBRB$M_ASSUME_PERSONA 0x20 #define PSBRB$M_SET_NATURAL 0x40 #if !defined(__NOBASEALIGN_SUPPORT) && !defined(__cplusplus) /* If using pre DECC V4.0 or C++ */ #pragma __nomember_alignment __quadword #else #pragma __nomember_alignment #endif typedef struct _psbrb { #pragma __nomember_alignment struct _psb *psbrb$l_flink; /* Standard listhead forward link */ struct _psb *psbrb$l_blink; /* Standard listhead backward link */ unsigned short int psbrb$w_size; /* Standard structure size, in bytes */ unsigned char psbrb$b_type; /* Standard type code for PSB (DYN$C_SECURITY) */ unsigned char psbrb$b_subtype; /* Standard subtype code (DYN$C_SECURITY_PRB) */ unsigned int psbrb$l_max_index; /* Maximum number of records in ring */ unsigned int psbrb$l_current_index; /* Index of nex record to be written in the RingBuffer */ #if defined(__VAXC) char psbrb$t_records[]; #else #define psbrb$t_records psbrb$r_fill_9_ #endif /* #if defined(__VAXC) */ __union { unsigned int psbrb$l_function; /* Define which support routine is reporting this record */ __struct { unsigned psbrb$v_clone_psb : 1; /* NSA$CLONE_PSB */ unsigned psbrb$v_dereference_psb : 1; /* NSA$DEREFERENCE_PSB */ unsigned psbrb$v_delete_persona : 1; /* NSA$DELETE_PERSONA */ unsigned psbrb$v_free_psb : 1; /* NSA$FREE_PSB */ unsigned psbrb$v_reference_psb : 1; /* NSA$REFERENCE_PSB */ unsigned psbrb$v_assume_persona : 1; /* NSA$ASSUME_PERSONA */ unsigned psbrb$v_set_natural : 1; /* NSA$SET_NATURAL */ unsigned psbrb$v_fill_11_ : 1; } psbrb$r_fill_10_; } psbrb$r_fill_9_; unsigned int psbrb$l_psb; /* Address of PSB being acted upon by the function */ unsigned int psbrb$l_refcnt; /* Current reference count the above PSB */ unsigned int psbrb$l_flags; /* Contents of PSB flags */ unsigned int psbrb$l_mode; /* Access mode of current PSB */ unsigned int psbrb$l_pc; /* Address from where the function was called */ unsigned int psbrb$l_psl; /* PSL at the time of the operation */ unsigned int psbrb$l_uthread_id; /* Current active DECthread (if any) */ unsigned int psbrb$l_ktb; /* Current KTB */ unsigned int psbrb$l_cpu; /* CPU ID from current KTB */ /* Function specific information */ unsigned int psbrb$l_aux_1; /* $Assume = previous PSB */ /* $Clone = PSB being created */ unsigned int psbrb$l_aux_2; /* $Assume = previous PSB reference count */ unsigned int psbrb$l_aux_3; /* debug_data_1 */ unsigned int psbrb$l_aux_4; /* debug_data_2 */ char psbrb$b_fill_12_ [4]; } PSBRB; #if !defined(__VAXC) #define psbrb$l_function psbrb$r_fill_9_.psbrb$l_function #define psbrb$v_clone_psb psbrb$r_fill_9_.psbrb$r_fill_10_.psbrb$v_clone_psb #define psbrb$v_dereference_psb psbrb$r_fill_9_.psbrb$r_fill_10_.psbrb$v_dereference_psb #define psbrb$v_delete_persona psbrb$r_fill_9_.psbrb$r_fill_10_.psbrb$v_delete_persona #define psbrb$v_free_psb psbrb$r_fill_9_.psbrb$r_fill_10_.psbrb$v_free_psb #define psbrb$v_reference_psb psbrb$r_fill_9_.psbrb$r_fill_10_.psbrb$v_reference_psb #define psbrb$v_assume_persona psbrb$r_fill_9_.psbrb$r_fill_10_.psbrb$v_assume_persona #define psbrb$v_set_natural psbrb$r_fill_9_.psbrb$r_fill_10_.psbrb$v_set_natural #endif /* #if !defined(__VAXC) */ #define PSBRB$K_RINGBUFFER_RECORD_SIZE 56 #define PSBRB$K_RINGBUFFER_RECORDS 1000 #define PSBRB$K_RINGBUFFER_SIZE 56020 #if defined (__ALPHA) || defined (__ia64) # ifdef __INITIAL_POINTER_SIZE # pragma __required_pointer_size __save /* Save current pointer size */ # pragma __required_pointer_size 32 /* And set ptr size default to 32-bit pointers */ typedef struct _psb * PSB_ps; /* 32-bit pointer signed to a PSB */ # pragma __required_pointer_size __restore /* Return to previous pointer size */ # else typedef signed __int32 PSB_ps; /* Same size as a 32-bit pointer signed to a PSB */ # endif #endif #pragma __member_alignment __restore #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __PSBDEF_LOADED */