@@ -117,9 +117,13 @@ void ProfilePostProcessor::postProcessSearchGeneric(SecurityRequest &request) {
117117
118118 for (int i = 0 ; i < found_profiles.size (); i++) {
119119 int len = std::strlen (found_profiles[i]);
120- std::string profile_name =
121- ProfilePostProcessor::decodeEBCDICBytes (found_profiles[i], len);
122- repeat_group_profiles.push_back (profile_name);
120+ if (len > 0 ) {
121+ std::string profile_name =
122+ ProfilePostProcessor::decodeEBCDICBytes (found_profiles[i], len);
123+ if (profile_name != " " && profile_name != " " ) {
124+ repeat_group_profiles.push_back (profile_name);
125+ }
126+ }
123127 free (found_profiles[i]);
124128 }
125129
@@ -208,6 +212,18 @@ void ProfilePostProcessor::postProcessRACFOptions(SecurityRequest &request) {
208212 request.setIntermediateResultJSON (profile);
209213}
210214
215+ // There are a bunch of these weird offset fields
216+ // This function allow offset fields to easily be processed
217+ void ProfilePostProcessor::postprocessRRSFOffsetField (nlohmann::json &profile, const std::string &key, const char *p_profile, int offset) {
218+ const racf_rrsf_offset_field_t *p_field =
219+ reinterpret_cast <const racf_rrsf_offset_field_t *>(p_profile + offset);
220+
221+ // Only create the key if there actually is any data in the offset field, avoids empty quotes
222+ if (p_field->length > 0 ) {
223+ profile[key] = ProfilePostProcessor::decodeEBCDICBytes (p_field->data ,p_field->length );
224+ }
225+ }
226+
211227// ////////////////////////////////////////////////////////////////////////
212228// RRSF post processing //
213229// ////////////////////////////////////////////////////////////////////////
@@ -262,6 +278,35 @@ void ProfilePostProcessor::postProcessRACFRRSF(SecurityRequest &request) {
262278 node_definition[" base:time_of_last_sent_work" ] = ProfilePostProcessor::decodeEBCDICBytes (p_nodes->time_of_last_sent_work ,8 );
263279 node_definition[" base:node_state" ] = p_nodes->rrsf_node_state ;
264280
281+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:node_description" , p_profile, p_nodes->offset_rrsf_node_description );
282+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:partner_node_dynamic_parse_level" ,p_profile, p_nodes->offset_partner_node_parse_level );
283+
284+ // Workspace dataset information
285+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:workspace_dataset_prefix" , p_profile, p_nodes->offset_rrsf_node_workspace_dataset_prefix );
286+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:workspace_dataset_name" , p_profile, p_nodes->offset_workspace_dataset_wdsqual );
287+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:workspace_dataset_sms_management_class" , p_profile, p_nodes->offset_rrsf_workspace_sms_management_class );
288+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:workspace_dataset_sms_storage_class" , p_profile, p_nodes->offset_rrsf_workspace_sms_storage_class );
289+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:workspace_dataset_sms_data_class" , p_profile, p_nodes->offset_rrsf_workspace_data_class );
290+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:workspace_dataset_volume" , p_profile, p_nodes->offset_rrsf_workspace_dataset_volume );
291+
292+ node_definition[" base:workspace_file_size" ] = p_nodes->rrsf_workspace_file_size ;
293+
294+ // inmsg and outmsg dataset information
295+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:in_message_dataset_name" , p_profile, p_nodes->offset_inmsg_dataset_name );
296+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:out_message_dataset_name" , p_profile, p_nodes->offset_outmsg_dataset_name );
297+
298+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:temporary_in_message_dataset_name" , p_profile, p_nodes->offset_inmsg2_dataset_name );
299+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:temporary_out_message_dataset_name" , p_profile, p_nodes->offset_outmsg2_dataset_name );
300+
301+ node_definition[" base:in_message_records" ] = p_nodes->inmsg_records ;
302+ node_definition[" base:out_message_records" ] = p_nodes->outmsg_records ;
303+ node_definition[" base:temporary_in_message_records" ] = p_nodes->inmsg2_records ;
304+ node_definition[" base:temporary_out_message_records" ] = p_nodes->outmsg2_records ;
305+ node_definition[" base:in_message_extents" ] = p_nodes->inmsg_extents ;
306+ node_definition[" base:out_message_extents" ] = p_nodes->outmsg_extents ;
307+ node_definition[" base:in_message2_extents" ] = p_nodes->inmsg2_extents ;
308+ node_definition[" base:out_message2_extents" ] = p_nodes->outmsg2_extents ;
309+
265310 // Partner node information
266311 node_definition[" base:partner_node_operating_system_version" ] = p_nodes->partner_node_os_version ;
267312 node_definition[" base:partner_node_template_release_level" ] = p_nodes->binary_partner_node_template_release_level ;
@@ -282,8 +327,22 @@ void ProfilePostProcessor::postProcessRACFRRSF(SecurityRequest &request) {
282327 // Determines which protocol the RRSF node is using and adds it to the result JSON
283328 if (p_nodes->rrsf_protocol == 01 ) {
284329 node_definition[" base:node_protocol" ] = " appc" ;
330+
331+ // These are only relevant if system is using APPC, instead of the modern TCP/IP
332+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:appc_modename" , p_profile, p_nodes->offset_appc_modename );
333+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:appc_lu_name" , p_profile, p_nodes->offset_appc_lu_name );
334+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:appc_tp_name" , p_profile, p_nodes->offset_appc_tp_name );
335+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:appc_netname" , p_profile, p_nodes->offset_appc_netname );
285336 } else if (p_nodes->rrsf_protocol == 02 ) {
286337 node_definition[" base:node_protocol" ] = " tcpip" ;
338+
339+ // These are only relevant if system is using TCPIP for RRSF
340+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:resolved_tcpip_address" , p_profile, p_nodes->offset_tcpip_address_resolved_by_system );
341+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:target_tcpip_address" , p_profile, p_nodes->offset_tcpip_address_target_command );
342+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:tcpip_port" , p_profile, p_nodes->offset_tcpip_port );
343+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:tcpip_attls_rule" , p_profile, p_nodes->offset_tcpip_tls_rule );
344+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:tcpip_attls_cipher" , p_profile, p_nodes->offset_tcpip_cipher_policy );
345+ ProfilePostProcessor::postprocessRRSFOffsetField (node_definition, " base:tcpip_attls_certificate_user" , p_profile, p_nodes->offset_tcpip_certificate_user );
287346 } else {
288347 node_definition[" base:node_protocol" ] = " none" ;
289348 }
0 commit comments