From 4c6e57ad311201cca3cab0c19a45767d8d87b581 Mon Sep 17 00:00:00 2001 From: UBiqube-ydu Date: Tue, 27 Jan 2026 14:18:32 +0100 Subject: [PATCH] OPSLAB-245: Fix create, update, delete config for Stormshield --- adapters/stormshield/apply_conf.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/adapters/stormshield/apply_conf.php b/adapters/stormshield/apply_conf.php index 420d06b8..40ea5b07 100644 --- a/adapters/stormshield/apply_conf.php +++ b/adapters/stormshield/apply_conf.php @@ -10,23 +10,20 @@ function apply_conf($configuration) { global $sms_sd_ctx; global $SMS_RETURN_BUF; + global $SMS_OUTPUT_BUF; // Save the configuration applied on the router save_result_file($configuration, 'conf.applied'); $SMS_OUTPUT_BUF = ''; - $line = get_one_line($configuration); - while ($line !== false) + if (empty($configuration)) { - $line = trim($line); - - if (!empty($line)) - { - $res = sendexpectone(__FILE__ . ':' . __LINE__, $sms_sd_ctx, $line, ''); - - $SMS_RETURN_BUF = json_encode($res); - } - $line = get_one_line($configuration); + $SMS_RETURN_BUF = '{}'; + } + else + { + $res = sendexpectone(__FILE__ . ':' . __LINE__, $sms_sd_ctx, $configuration, ''); + $SMS_RETURN_BUF = json_encode($res); } return SMS_OK;