From df79950a7754c2e6b76acbdc943c387f1bccca19 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 10 Dec 2019 13:31:12 +0100 Subject: [PATCH] Solve issues with comments with quotes in CLI --- pandora_server/util/pandora_manage.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index d9e880d236..9b0ad29abd 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -4092,7 +4092,7 @@ sub cli_create_event() { $custom_data = encode_base64 ($custom_data); pandora_event ($conf, $event, $id_group, $id_agent, $severity, - $id_alert_agent_module, $id_agentmodule, $event_type, $event_status, $dbh, $source, $user_name, $comment, $id_extra, $tags, $c_instructions, $w_instructions, $u_instructions, $custom_data); + $id_alert_agent_module, $id_agentmodule, $event_type, $event_status, $dbh, $source, $user_name, safe_input($comment), $id_extra, $tags, $c_instructions, $w_instructions, $u_instructions, $custom_data); } } else { if (! $agent_name) { @@ -4142,7 +4142,7 @@ sub cli_create_event() { $custom_data = encode_base64 ($custom_data); pandora_event ($conf, $event, $id_group, $id_agent, $severity, - $id_alert_agent_module, $id_agentmodule, $event_type, $event_status, $dbh, $source, $user_name, $comment, $id_extra, $tags, $c_instructions, $w_instructions, $u_instructions, $custom_data); + $id_alert_agent_module, $id_agentmodule, $event_type, $event_status, $dbh, $source, $user_name, safe_input($comment), $id_extra, $tags, $c_instructions, $w_instructions, $u_instructions, $custom_data); } } @@ -4329,7 +4329,7 @@ sub cli_add_event_comment() { my $current_comment = encode_utf8(pandora_get_event_comment($dbh, $id_event)); my $utimestamp = time (); - my @additional_comment = ({ comment => $comment, action => "Added comment", id_user => $id_user, utimestamp => $utimestamp}); + my @additional_comment = ({ comment => safe_input($comment), action => "Added comment", id_user => $id_user, utimestamp => $utimestamp}); print_log "[INFO] Adding event comment for event '$id_event'. \n\n";