2011-09-12 Vanessa Gil <vanessa.gil@artica.es>

* pandora_server/util/pandora_manage.pl: Applied Kosaka's patch to store
	data in DB with encoding in HTML entities.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4939 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2011-09-12 13:25:19 +00:00
parent bd250bfc78
commit 1dcc5481eb
2 changed files with 16 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2011-09-12 Vanessa Gil <vanessa.gil@artica.es>
* 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 <dario.rodriguez@artica.es> 2011-09-12 Dario Rodriguez <dario.rodriguez@artica.es>
* util/recon_scripts/snmpdevices.pl: Fixed some problems with the script. * util/recon_scripts/snmpdevices.pl: Fixed some problems with the script.

View File

@ -537,7 +537,7 @@ sub pandora_manage_main ($$$) {
print "[INFO] Creating agent '$agent_name'\n\n"; print "[INFO] Creating agent '$agent_name'\n\n";
$address = '' unless defined ($address); $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); $interval = 300 unless defined ($interval);
my $id_group = get_group_id($dbh,$group_name); my $id_group = get_group_id($dbh,$group_name);
@ -631,7 +631,7 @@ sub pandora_manage_main ($$$) {
my %parameters; my %parameters;
$parameters{'id_tipo_modulo'} = $module_type_id; $parameters{'id_tipo_modulo'} = $module_type_id;
$parameters{'nombre'} = $module_name; $parameters{'nombre'} = safe_input($module_name);
$parameters{'id_agente'} = $agent_id; $parameters{'id_agente'} = $agent_id;
# Optional parameters # Optional parameters
@ -641,7 +641,7 @@ sub pandora_manage_main ($$$) {
$parameters{'min_critical'} = $critical_min unless !defined ($critical_min); $parameters{'min_critical'} = $critical_min unless !defined ($critical_min);
$parameters{'max_critical'} = $critical_max unless !defined ($critical_max); $parameters{'max_critical'} = $critical_max unless !defined ($critical_max);
$parameters{'history_data'} = $history_data unless !defined ($history_data); $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{'min'} = $min unless !defined ($min);
$parameters{'max'} = $max unless !defined ($max); $parameters{'max'} = $max unless !defined ($max);
$parameters{'post_process'} = $post_process unless !defined ($post_process); $parameters{'post_process'} = $post_process unless !defined ($post_process);
@ -698,7 +698,7 @@ sub pandora_manage_main ($$$) {
my %parameters; my %parameters;
$parameters{'id_tipo_modulo'} = $module_type_id; $parameters{'id_tipo_modulo'} = $module_type_id;
$parameters{'nombre'} = $module_name; $parameters{'nombre'} = safe_input($module_name);
$parameters{'id_agente'} = $agent_id; $parameters{'id_agente'} = $agent_id;
$parameters{'ip_target'} = $module_address; $parameters{'ip_target'} = $module_address;
@ -710,7 +710,7 @@ sub pandora_manage_main ($$$) {
$parameters{'max_critical'} = $critical_max unless !defined ($critical_max); $parameters{'max_critical'} = $critical_max unless !defined ($critical_max);
$parameters{'history_data'} = $history_data unless !defined ($history_data); $parameters{'history_data'} = $history_data unless !defined ($history_data);
$parameters{'tcp_port'} = $module_port unless !defined ($module_port); $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{'min'} = $min unless !defined ($min);
$parameters{'max'} = $max unless !defined ($max); $parameters{'max'} = $max unless !defined ($max);
$parameters{'post_process'} = $post_process unless !defined ($post_process); $parameters{'post_process'} = $post_process unless !defined ($post_process);
@ -756,7 +756,7 @@ sub pandora_manage_main ($$$) {
my %parameters; my %parameters;
$parameters{'id_tipo_modulo'} = $module_type_id; $parameters{'id_tipo_modulo'} = $module_type_id;
$parameters{'nombre'} = $module_name; $parameters{'nombre'} = safe_input($module_name);
$parameters{'id_agente'} = $agent_id; $parameters{'id_agente'} = $agent_id;
$parameters{'ip_target'} = $module_address; $parameters{'ip_target'} = $module_address;
$parameters{'tcp_port'} = $module_port; $parameters{'tcp_port'} = $module_port;
@ -769,7 +769,7 @@ sub pandora_manage_main ($$$) {
$parameters{'min_critical'} = $critical_min unless !defined ($critical_min); $parameters{'min_critical'} = $critical_min unless !defined ($critical_min);
$parameters{'max_critical'} = $critical_max unless !defined ($critical_max); $parameters{'max_critical'} = $critical_max unless !defined ($critical_max);
$parameters{'history_data'} = $history_data unless !defined ($history_data); $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{'min'} = $min unless !defined ($min);
$parameters{'max'} = $max unless !defined ($max); $parameters{'max'} = $max unless !defined ($max);
$parameters{'post_process'} = $post_process unless !defined ($post_process); $parameters{'post_process'} = $post_process unless !defined ($post_process);
@ -830,7 +830,7 @@ sub pandora_manage_main ($$$) {
my %parameters; my %parameters;
$parameters{'id_tipo_modulo'} = $module_type_id; $parameters{'id_tipo_modulo'} = $module_type_id;
$parameters{'nombre'} = $module_name; $parameters{'nombre'} = safe_input($module_name);
$parameters{'id_agente'} = $agent_id; $parameters{'id_agente'} = $agent_id;
$parameters{'ip_target'} = $module_address; $parameters{'ip_target'} = $module_address;
$parameters{'tcp_port'} = $module_port; $parameters{'tcp_port'} = $module_port;
@ -846,7 +846,7 @@ sub pandora_manage_main ($$$) {
$parameters{'min_critical'} = $critical_min unless !defined ($critical_min); $parameters{'min_critical'} = $critical_min unless !defined ($critical_min);
$parameters{'max_critical'} = $critical_max unless !defined ($critical_max); $parameters{'max_critical'} = $critical_max unless !defined ($critical_max);
$parameters{'history_data'} = $history_data unless !defined ($history_data); $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{'min'} = $min unless !defined ($min);
$parameters{'max'} = $max unless !defined ($max); $parameters{'max'} = $max unless !defined ($max);
$parameters{'post_process'} = $post_process unless !defined ($post_process); $parameters{'post_process'} = $post_process unless !defined ($post_process);
@ -1019,7 +1019,7 @@ sub pandora_manage_main ($$$) {
param_check($ltotal, 4, 1); param_check($ltotal, 4, 1);
my ($user_name,$password,$is_admin,$comments) = @ARGV[2..5]; 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"; print "[INFO] Creating user '$user_name'\n\n";