[Snort-users] BASE 1.1 release

Michael Stone mstone+snort at ...10946...
Wed Apr 6 08:23:51 EDT 2005


On Tue, Apr 05, 2005 at 11:37:11AM +0900, Basselgia, Barry A Mr (NAF Atsugi) wrote:
>Now when I click on the links on the main page I get the following:
>
>Fatal error: Call to a member function on a non-object in
>/srv/www/htdocs/base/includes/base_state_citems.inc.php on line 498

Try the following patch:


--- /tmp/base-1.1/includes/base_state_criteria.inc.php Mon Apr  4 18:26:53 2005
+++ includes/base_state_criteria.inc.php  Wed Apr  6 14:57:48 2005
@@ -42,25 +42,25 @@
      /* XXX-SEC */
      GLOBAL $db;
 
-     $db =& $db;
+     $tdb =& $db;
      $obj =& $this;
-     $this->criteria['sig'] = new SignatureCriteria($db, $obj, "sig");
-     $this->criteria['sig_class'] = new SignatureClassificationCriteria($db, $obj, "sig_class");
-     $this->criteria['sig_priority'] = new SignaturePriorityCriteria($db, $obj, "sig_priority");
-     $this->criteria['ag'] = new AlertGroupCriteria($db, $obj, "ag");
-     $this->criteria['sensor'] = new SensorCriteria($db, $obj, "sensor");
-     $this->criteria['time'] = new TimeCriteria($db, $obj, "time", TIME_CFCNT);
-     $this->criteria['ip_addr'] = new IPAddressCriteria($db, $obj, "ip_addr", IPADDR_CFCNT);
-     $this->criteria['layer4'] = new Layer4Criteria($db, $obj, "layer4");
-     $this->criteria['ip_field'] = new IPFieldCriteria($db, $obj, "ip_field", PROTO_CFCNT);
-     $this->criteria['tcp_port'] = new TCPPortCriteria($db, $obj, "tcp_port", PROTO_CFCNT);
-     $this->criteria['tcp_flags'] = new TCPFlagsCriteria($db, $obj, "tcp_flags");
-     $this->criteria['tcp_field'] = new TCPFieldCriteria($db, $obj, "tcp_field", PROTO_CFCNT);
-     $this->criteria['udp_port'] = new UDPPortCriteria($db, $obj, "udp_port", PROTO_CFCNT);
-     $this->criteria['udp_field'] = new UDPFieldCriteria($db, $obj, "udp_field", PROTO_CFCNT);
-     $this->criteria['icmp_field'] = new ICMPFieldCriteria($db, $obj, "icmp_field", PROTO_CFCNT);
-     $this->criteria['rawip_field'] = new TCPFieldCriteria($db, $obj, "rawip_field", PROTO_CFCNT);
-     $this->criteria['data'] = new DataCriteria($db, $obj, "data", PAYLOAD_CFCNT);
+     $this->criteria['sig'] = new SignatureCriteria($tdb, $obj, "sig");
+     $this->criteria['sig_class'] = new SignatureClassificationCriteria($tdb, $obj, "sig_class");
+     $this->criteria['sig_priority'] = new SignaturePriorityCriteria($tdb, $obj, "sig_priority");
+     $this->criteria['ag'] = new AlertGroupCriteria($tdb, $obj, "ag");
+     $this->criteria['sensor'] = new SensorCriteria($tdb, $obj, "sensor");
+     $this->criteria['time'] = new TimeCriteria($tdb, $obj, "time", TIME_CFCNT);
+     $this->criteria['ip_addr'] = new IPAddressCriteria($tdb, $obj, "ip_addr", IPADDR_CFCNT);
+     $this->criteria['layer4'] = new Layer4Criteria($tdb, $obj, "layer4");
+     $this->criteria['ip_field'] = new IPFieldCriteria($tdb, $obj, "ip_field", PROTO_CFCNT);
+     $this->criteria['tcp_port'] = new TCPPortCriteria($tdb, $obj, "tcp_port", PROTO_CFCNT);
+     $this->criteria['tcp_flags'] = new TCPFlagsCriteria($tdb, $obj, "tcp_flags");
+     $this->criteria['tcp_field'] = new TCPFieldCriteria($tdb, $obj, "tcp_field", PROTO_CFCNT);
+     $this->criteria['udp_port'] = new UDPPortCriteria($tdb, $obj, "udp_port", PROTO_CFCNT);
+     $this->criteria['udp_field'] = new UDPFieldCriteria($tdb, $obj, "udp_field", PROTO_CFCNT);
+     $this->criteria['icmp_field'] = new ICMPFieldCriteria($tdb, $obj, "icmp_field", PROTO_CFCNT);
+     $this->criteria['rawip_field'] = new TCPFieldCriteria($tdb, $obj, "rawip_field", PROTO_CFCNT);
+     $this->criteria['data'] = new DataCriteria($tdb, $obj, "data", PAYLOAD_CFCNT);
 
      /* 
       * For new criteria, add a call to the appropriate constructor here, and implement
--- /tmp/base-1.1/includes/base_state_citems.inc.php	Sun Apr  3 20:27:00 2005
+++ includes/base_state_citems.inc.php	Wed Apr  6 15:18:37 2005
@@ -154,10 +154,10 @@
 
    function MultipleElementCriteria(&$db, &$cs, $export_name, $element_cnt, $field_list = NULL)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      $this->BaseCriteria($db, $cs, $export_name);
+      $this->BaseCriteria($tdb, $cs, $export_name);
 
       $this->element_cnt = $element_cnt;
       $this->criteria_cnt = 0;
@@ -337,10 +337,10 @@
 
    function SignatureCriteria(&$db, &$cs, $export_name)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      $this->BaseCriteria($db, $cs, $export_name);
+      $this->BaseCriteria($tdb, $cs, $export_name);
 
       $this->sig_type = "";
    }
@@ -844,10 +844,10 @@
 
    function IPAddressCriteria(&$db, &$cs, $export_name, $element_cnt)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      parent::MultipleElementCriteria($db, $cs, $export_name, $element_cnt,
+      parent::MultipleElementCriteria($tdb, $cs, $export_name, $element_cnt,
                                       array ("ip_src" => _SOURCE,
                                              "ip_dst" => _DEST,
                                              "ip_both" => _SORD));
@@ -1018,10 +1018,10 @@
 
    function IPFieldCriteria(&$db, &$cs, $export_name, $element_cnt)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      parent::ProtocolFieldCriteria($db, $cs, $export_name, $element_cnt,
+      parent::ProtocolFieldCriteria($tdb, $cs, $export_name, $element_cnt,
                                     array("ip_tos"  => "TOS",
                                           "ip_ttl"  => "TTL",
                                           "ip_id"   => "ID",
@@ -1061,10 +1061,10 @@
 
    function TCPPortCriteria(&$db, &$cs, $export_name, $element_cnt)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      parent::ProtocolFieldCriteria($db, $cs, $export_name, $element_cnt,
+      parent::ProtocolFieldCriteria($tdb, $cs, $export_name, $element_cnt,
                                     array ("layer4_sport" => "source port",
                                            "layer4_dport" => "dest port"));
    }
@@ -1101,10 +1101,10 @@
 
    function TCPFieldCriteria(&$db, &$cs, $export_name, $element_cnt)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      parent::ProtocolFieldCriteria($db, $cs, $export_name, $element_cnt,
+      parent::ProtocolFieldCriteria($tdb, $cs, $export_name, $element_cnt,
                                     array ("tcp_win" => "window",  
                                            "tcp_urp" => "urp",
                                            "tcp_seq" => "seq #",
@@ -1232,10 +1232,10 @@
 
    function UDPPortCriteria(&$db, &$cs, $export_name, $element_cnt)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      parent::ProtocolFieldCriteria($db, $cs, $export_name, $element_cnt,
+      parent::ProtocolFieldCriteria($tdb, $cs, $export_name, $element_cnt,
                                     array ("layer4_sport" => "source port",
                                            "layer4_dport" => "dest port"));
    }
@@ -1270,10 +1270,10 @@
 
    function UDPFieldCriteria(&$db, &$cs, $export_name, $element_cnt)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      parent::ProtocolFieldCriteria($db, $cs, $export_name, $element_cnt, 
+      parent::ProtocolFieldCriteria($tdb, $cs, $export_name, $element_cnt, 
                                     array ("udp_len" => "length",
                                            "udp_csum" => "chksum"));
    }
@@ -1307,10 +1307,10 @@
 
    function ICMPFieldCriteria(&$db, &$cs, $export_name, $element_cnt)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      parent::ProtocolFieldCriteria($db, $cs, $export_name, $element_cnt, 
+      parent::ProtocolFieldCriteria($tdb, $cs, $export_name, $element_cnt, 
                                     array ("icmp_type" => "type",
                                            "icmp_code" => "code",
                                            "icmp_id"   => "id",
@@ -1411,10 +1411,10 @@
 
    function DataCriteria(&$db, &$cs, $export_name, $element_cnt)
    {
-	$db =& $db;
+	$tdb =& $db;
 	$cs =& $cs;
 
-      parent::MultipleElementCriteria($db, $cs, $export_name, $element_cnt,
+      parent::MultipleElementCriteria($tdb, $cs, $export_name, $element_cnt,
                                       array ("LIKE" => "has",
                                              "NOT LIKE" => "has NOT" ));
       $this->data_encode = array();




More information about the Snort-users mailing list