diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index a4954b096e..aea45f6288 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2011-09-12 Vanessa Gil + + * pandora_server/util/pandora_manage.pl: Applied Kosaka's patch to store + data in DB with encoding in HTML entities. + + 2011-09-12 Dario Rodriguez * util/recon_scripts/snmpdevices.pl: Fixed some problems with the script. diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 976fb36f66..04f4d3808c 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -537,7 +537,7 @@ sub pandora_manage_main ($$$) { print "[INFO] Creating agent '$agent_name'\n\n"; $address = '' unless defined ($address); - $description = '' unless defined ($description); + $description = (defined ($description) ? safe_input($description) : '' ); # safe_input() might be better at pandora_create_agent() (when passing 'description' to db_insert()) $interval = 300 unless defined ($interval); my $id_group = get_group_id($dbh,$group_name); @@ -631,7 +631,7 @@ sub pandora_manage_main ($$$) { my %parameters; $parameters{'id_tipo_modulo'} = $module_type_id; - $parameters{'nombre'} = $module_name; + $parameters{'nombre'} = safe_input($module_name); $parameters{'id_agente'} = $agent_id; # Optional parameters @@ -641,7 +641,7 @@ sub pandora_manage_main ($$$) { $parameters{'min_critical'} = $critical_min unless !defined ($critical_min); $parameters{'max_critical'} = $critical_max unless !defined ($critical_max); $parameters{'history_data'} = $history_data unless !defined ($history_data); - $parameters{'descripcion'} = $description unless !defined ($description); + $parameters{'descripcion'} = safe_input($description) unless !defined ($description); $parameters{'min'} = $min unless !defined ($min); $parameters{'max'} = $max unless !defined ($max); $parameters{'post_process'} = $post_process unless !defined ($post_process); @@ -698,7 +698,7 @@ sub pandora_manage_main ($$$) { my %parameters; $parameters{'id_tipo_modulo'} = $module_type_id; - $parameters{'nombre'} = $module_name; + $parameters{'nombre'} = safe_input($module_name); $parameters{'id_agente'} = $agent_id; $parameters{'ip_target'} = $module_address; @@ -710,7 +710,7 @@ sub pandora_manage_main ($$$) { $parameters{'max_critical'} = $critical_max unless !defined ($critical_max); $parameters{'history_data'} = $history_data unless !defined ($history_data); $parameters{'tcp_port'} = $module_port unless !defined ($module_port); - $parameters{'descripcion'} = $description unless !defined ($description); + $parameters{'descripcion'} = safe_input($description) unless !defined ($description); $parameters{'min'} = $min unless !defined ($min); $parameters{'max'} = $max unless !defined ($max); $parameters{'post_process'} = $post_process unless !defined ($post_process); @@ -756,7 +756,7 @@ sub pandora_manage_main ($$$) { my %parameters; $parameters{'id_tipo_modulo'} = $module_type_id; - $parameters{'nombre'} = $module_name; + $parameters{'nombre'} = safe_input($module_name); $parameters{'id_agente'} = $agent_id; $parameters{'ip_target'} = $module_address; $parameters{'tcp_port'} = $module_port; @@ -769,7 +769,7 @@ sub pandora_manage_main ($$$) { $parameters{'min_critical'} = $critical_min unless !defined ($critical_min); $parameters{'max_critical'} = $critical_max unless !defined ($critical_max); $parameters{'history_data'} = $history_data unless !defined ($history_data); - $parameters{'descripcion'} = $description unless !defined ($description); + $parameters{'descripcion'} = safe_input($description) unless !defined ($description); $parameters{'min'} = $min unless !defined ($min); $parameters{'max'} = $max unless !defined ($max); $parameters{'post_process'} = $post_process unless !defined ($post_process); @@ -830,7 +830,7 @@ sub pandora_manage_main ($$$) { my %parameters; $parameters{'id_tipo_modulo'} = $module_type_id; - $parameters{'nombre'} = $module_name; + $parameters{'nombre'} = safe_input($module_name); $parameters{'id_agente'} = $agent_id; $parameters{'ip_target'} = $module_address; $parameters{'tcp_port'} = $module_port; @@ -846,7 +846,7 @@ sub pandora_manage_main ($$$) { $parameters{'min_critical'} = $critical_min unless !defined ($critical_min); $parameters{'max_critical'} = $critical_max unless !defined ($critical_max); $parameters{'history_data'} = $history_data unless !defined ($history_data); - $parameters{'descripcion'} = $description unless !defined ($description); + $parameters{'descripcion'} = safe_input($description) unless !defined ($description); $parameters{'min'} = $min unless !defined ($min); $parameters{'max'} = $max unless !defined ($max); $parameters{'post_process'} = $post_process unless !defined ($post_process); @@ -1019,7 +1019,7 @@ sub pandora_manage_main ($$$) { param_check($ltotal, 4, 1); my ($user_name,$password,$is_admin,$comments) = @ARGV[2..5]; - $comments = '' unless defined ($comments); + $comments = (defined ($comments) ? safe_input($comments) : '' ); print "[INFO] Creating user '$user_name'\n\n";