@@ -699,12 +699,6 @@ function syslog_remove_items($table, $max_seq) {
699699 $ params [] = '% ' . $ remove ['message ' ];
700700 }
701701 } elseif ($ remove ['type ' ] == 'sql ' ) {
702- if (read_config_option ('syslog_allow_sql_rules ' ) != 'on ' ) {
703- cacti_log ("SYSLOG: Skipping SQL removal rule ' " . $ remove ['name ' ] . "'; set 'Allow SQL-type rules' in Syslog settings to enable " , false , 'SYSLOG ' );
704-
705- continue ;
706- }
707-
708702 if ($ table == 'syslog_incoming ' ) {
709703 $ sql_where = 'WHERE ( ' . $ remove ['message ' ] . ')
710704 AND `status` = 1
@@ -1181,19 +1175,6 @@ function syslog_manage_items($from_table, $to_table) {
11811175 WHERE message LIKE " . db_qstr ('% ' . $ remove ['message ' ]);
11821176 }
11831177 } elseif ($ remove ['type ' ] == 'sql ' ) {
1184- /*
1185- * Raw SQL rules are admin-defined expressions interpolated
1186- * into the WHERE clause. They are dangerous by design and
1187- * gated behind an explicit opt-in. The previous syntax
1188- * ("WHERE message (expr)") was also invalid MySQL and could
1189- * never have executed successfully.
1190- */
1191- if (read_config_option ('syslog_allow_sql_rules ' ) != 'on ' ) {
1192- cacti_log ("SYSLOG: Skipping SQL removal rule ' " . $ remove ['name ' ] . "'; set 'Allow SQL-type rules' in Syslog settings to enable " , false , 'SYSLOG ' );
1193-
1194- continue ;
1195- }
1196-
11971178 if ($ remove ['method ' ] != 'del ' ) {
11981179 $ sql_sel = "SELECT seq FROM ` $ syslogdb_default`.` $ from_table`
11991180 WHERE ( " . $ remove ['message ' ] . ') ' ;
@@ -1909,18 +1890,6 @@ function syslog_get_alert_sql(&$alert, $max_seq) {
19091890 $ params [] = $ alert ['message ' ];
19101891 $ params [] = $ max_seq ;
19111892 } elseif ($ alert ['type ' ] == 'sql ' ) {
1912- /*
1913- * Raw SQL alert expressions are admin-defined fragments inlined
1914- * into the WHERE clause. They cannot be parameterised and are
1915- * gated behind an explicit opt-in. When disabled, the alert is
1916- * skipped rather than silently matching everything.
1917- */
1918- if (read_config_option ('syslog_allow_sql_rules ' ) != 'on ' ) {
1919- cacti_log ("SYSLOG: Skipping SQL alert ' " . $ alert ['name ' ] . "'; set 'Allow SQL-type rules' in Syslog settings to enable " , false , 'SYSLOG ' );
1920-
1921- return [];
1922- }
1923-
19241893 $ sql = "SELECT *
19251894 FROM ` $ syslogdb_default`.`syslog_incoming`
19261895 WHERE ( {$ alert ['message ' ]})
@@ -2527,18 +2496,6 @@ function syslog_get_report_sql(&$report) {
25272496 }
25282497
25292498 if ($ report ['type ' ] == 'sql ' ) {
2530- /*
2531- * Raw SQL report expressions are admin-defined fragments inlined
2532- * into the WHERE clause. They cannot be parameterised and are
2533- * gated behind an explicit opt-in. When disabled, the report is
2534- * skipped rather than silently returning every row.
2535- */
2536- if (read_config_option ('syslog_allow_sql_rules ' ) != 'on ' ) {
2537- cacti_log ("SYSLOG: Skipping SQL report ' " . $ report ['name ' ] . "'; set 'Allow SQL-type rules' in Syslog settings to enable " , false , 'SYSLOG ' );
2538-
2539- return '' ;
2540- }
2541-
25422499 $ sql = "SELECT *
25432500 FROM ` $ syslogdb_default`.`syslog`
25442501 WHERE ( " . $ report ['message ' ] . ') ' ;
0 commit comments