From 0f0c7350237e5d26a4f6c83ea1581cecf976bbd7 Mon Sep 17 00:00:00 2001 From: "Infineon\\StieberD" Date: Tue, 29 Jul 2025 11:54:53 -0700 Subject: [PATCH] added SYSOBJ check to the PostProcedure service to prevent invalid procedures from getting posted to the procedure queue --- LSL2/STPROC/SERVICE_SERVICES.txt | 28 ++++++++++++++++++---------- LSL2/STPROC/TW_USE_ACTIONS.txt | 2 +- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/LSL2/STPROC/SERVICE_SERVICES.txt b/LSL2/STPROC/SERVICE_SERVICES.txt index 833c35f..209aad9 100644 --- a/LSL2/STPROC/SERVICE_SERVICES.txt +++ b/LSL2/STPROC/SERVICE_SERVICES.txt @@ -346,17 +346,25 @@ Service PostProcedure(ProcedureName, Params) ErrorMsg = '' If (ProcedureName NE '') then - RequestKeyID = RTI_CreateGUID() - RequestRow = '' - RequestRow = ProcedureName - RequestRow = Params - RequestRow = Datetime() - RequestRow = 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 = ProcedureName + RequestRow = Params + RequestRow = Datetime() + RequestRow = 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.' diff --git a/LSL2/STPROC/TW_USE_ACTIONS.txt b/LSL2/STPROC/TW_USE_ACTIONS.txt index ef7bc4a..ec61b6d 100644 --- a/LSL2/STPROC/TW_USE_ACTIONS.txt +++ b/LSL2/STPROC/TW_USE_ACTIONS.txt @@ -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