added SYSOBJ check to the PostProcedure service to prevent invalid procedures from getting posted to the procedure queue

This commit is contained in:
Infineon\StieberD
2025-07-29 11:54:53 -07:00
parent 4eee1b0f0a
commit 0f0c735023
2 changed files with 19 additions and 11 deletions

View File

@ -346,17 +346,25 @@ Service PostProcedure(ProcedureName, Params)
ErrorMsg = ''
If (ProcedureName NE '') then
RequestKeyID = RTI_CreateGUID()
RequestRow = ''
RequestRow<PROC_QUEUE.PROC_NAME$> = ProcedureName
RequestRow<PROC_QUEUE.PARAMS$> = Params
RequestRow<PROC_QUEUE.ENTRY_DTM$> = Datetime()
RequestRow<PROC_QUEUE.IN_QUEUE$> = False$
Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyID, RequestRow, True$, False$, False$)
If Error_Services('NoError') then
Response = RequestKeyId
ProcedureName = UCase(ProcedureName)
LSL2Key = '$':ProcedureName:'*LSL2'
FrameworksKey = '$':ProcedureName:'*FRAMEWORKS'
SysprogKey = '$':ProcedureName
If ( RowExists('SYSOBJ', LSL2Key) or RowExists('SYSOBJ', FrameworksKey) or RowExists('SYSOBJ', SysprogKey) ) then
RequestKeyID = RTI_CreateGUID()
RequestRow = ''
RequestRow<PROC_QUEUE.PROC_NAME$> = ProcedureName
RequestRow<PROC_QUEUE.PARAMS$> = Params
RequestRow<PROC_QUEUE.ENTRY_DTM$> = Datetime()
RequestRow<PROC_QUEUE.IN_QUEUE$> = False$
Database_Services('WriteDataRow', 'PROC_QUEUE2', RequestKeyID, RequestRow, True$, False$, False$)
If Error_Services('NoError') then
Response = RequestKeyId
end else
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
end
end else
ErrorMsg = 'Error in ':Service:' service. Error message: ':Error_Services('GetMessage')
ErrorMsg = 'Error in ':Service:' service. PROC_NAME ':Quote(ProcedureName):' does not exist.'
end
end else
ErrorMsg = 'Error in ':Service:' service. Null ProcedureName passed in.'

View File

@ -164,7 +164,7 @@ WRITE_RECORD:
MetrologyID = Field(Name, '*', 1)
RDSNo = Xlate('RDS_TEST', MetrologyID, RDS_TEST_RDS_NO$, 'X')
Service_Services('PostProcedure', 'RDS_Services', 'AllTWUseSigned':SD$:RDSNo)
Service_Services('PostProcedure', 'RDS_SERVICES', 'AllTWUseSigned':SD$:RDSNo)
end
return