Fixed master server queries:

* safe_input is required for server_name
* Fixed wrong server_type specified in NetworkServer

(cherry picked from commit (77354a886e)
This commit is contained in:
KIKUCHI Koichiro 2015-03-24 19:28:46 +09:00
parent 471492807d
commit d7b3c9e0fb
4 changed files with 8 additions and 8 deletions

View File

@ -108,7 +108,7 @@ sub data_producer ($) {
'AND tagente_modulo.disabled = 0
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()))
ORDER BY tagente_modulo.flag DESC, time_left ASC, tagente_estado.last_execution_try ASC ', $pa_config->{'servername'});
ORDER BY tagente_modulo.flag DESC, time_left ASC, tagente_estado.last_execution_try ASC ', safe_input($pa_config->{'servername'}));
} else {
@rows = get_db_rows ($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.flag, tagente_estado.last_execution_try, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
FROM tagente, tagente_modulo, tagente_estado
@ -121,7 +121,7 @@ sub data_producer ($) {
. (defined ($network_filter) ? $network_filter : ' ') .
'AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND (tagente_modulo.flag = 1 OR ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()))
ORDER BY tagente_modulo.flag DESC, time_left ASC, tagente_estado.last_execution_try ASC', $pa_config->{'servername'}, DATASERVER);
ORDER BY tagente_modulo.flag DESC, time_left ASC, tagente_estado.last_execution_try ASC', safe_input($pa_config->{'servername'}), NETWORKSERVER);
}
foreach my $row (@rows) {

View File

@ -106,7 +106,7 @@ sub data_producer ($) {
AND tagente_modulo.disabled = 0
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND (tagente_modulo.flag = 1 OR (tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', $pa_config->{'servername'});
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', safe_input($pa_config->{'servername'}));
} else {
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
FROM tagente, tagente_modulo, tagente_estado
@ -117,7 +117,7 @@ sub data_producer ($) {
AND tagente_modulo.id_plugin != 0
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND (tagente_modulo.flag = 1 OR (tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', $pa_config->{'servername'}, PLUGINSERVER);
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', safe_input($pa_config->{'servername'}), PLUGINSERVER);
}
foreach my $row (@rows) {

View File

@ -105,7 +105,7 @@ sub data_producer ($) {
AND tagente_modulo.id_modulo = 5
AND (tagente_modulo.flag = 1
OR (tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())
ORDER BY last_execution_try ASC ', $pa_config->{'servername'});
ORDER BY last_execution_try ASC ', safe_input($pa_config->{'servername'}));
}
else {
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo),
@ -123,7 +123,7 @@ sub data_producer ($) {
AND tagente_modulo.id_modulo = 5
AND (tagente_modulo.flag = 1
OR (tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP())
ORDER BY last_execution_try ASC', $pa_config->{'servername'}, PREDICTIONSERVER);
ORDER BY last_execution_try ASC', safe_input($pa_config->{'servername'}), PREDICTIONSERVER);
}
foreach my $row (@rows) {

View File

@ -105,7 +105,7 @@ sub data_producer ($) {
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP()
OR tagente_modulo.flag = 1)
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', $pa_config->{'servername'});
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', safe_input($pa_config->{'servername'}));
} else {
@rows = get_db_rows ($dbh, 'SELECT DISTINCT(tagente_modulo.id_agente_modulo), tagente_modulo.flag, tagente_estado.current_interval + tagente_estado.last_execution_try AS time_left, last_execution_try
FROM tagente, tagente_modulo, tagente_estado, tserver
@ -116,7 +116,7 @@ sub data_producer ($) {
AND tagente_modulo.id_modulo = 6
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND ((tagente_estado.last_execution_try + tagente_estado.current_interval) < UNIX_TIMESTAMP() OR tagente_modulo.flag = 1 )
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', $pa_config->{'servername'}, WMISERVER);
ORDER BY tagente_modulo.flag DESC, time_left ASC, last_execution_try ASC', safe_input($pa_config->{'servername'}), WMISERVER);
}
foreach my $row (@rows) {