<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[128368] trunk/dports/security/base</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/128368">128368</a></dd>
<dt>Author</dt> <dd>khindenburg@macports.org</dd>
<dt>Date</dt> <dd>2014-11-19 19:49:03 -0800 (Wed, 19 Nov 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>base (port): update to 1.4.5; add patch php ereg_replace deprecated, mysqli usage instead of deprecated one; add license; patches from #42857</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportssecuritybasePortfile">trunk/dports/security/base/Portfile</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/dports/security/base/files/</li>
<li><a href="#trunkdportssecuritybasefilespatchbasediff">trunk/dports/security/base/files/patch-base.diff</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportssecuritybasePortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/security/base/Portfile (128367 => 128368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/security/base/Portfile        2014-11-20 02:54:57 UTC (rev 128367)
+++ trunk/dports/security/base/Portfile        2014-11-20 03:49:03 UTC (rev 128368)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> PortSystem 1.0
</span><span class="cx">
</span><span class="cx"> name base
</span><del>-version 1.3.9
</del><ins>+version 1.4.5
</ins><span class="cx"> categories security
</span><span class="cx"> maintainers nomaintainer
</span><span class="cx"> description Basic Analysis and Security Engine - Snort web frontend
</span><span class="lines">@@ -12,12 +12,22 @@
</span><span class="cx"> project. It provides a web front-end to query and analyze \
</span><span class="cx"> the alerts from SNORT.
</span><span class="cx"> platforms darwin
</span><del>-homepage http://secureideas.sourceforge.net/
</del><ins>+license GPL-2
+homepage http://base.professionallyevil.com
</ins><span class="cx"> master_sites sourceforge:secureideas
</span><del>-checksums md5 66e50f45c6bbf6b0cb2913b8c67f50d6
</del><ins>+
+checksums rmd160 e66552039a806d09db40f1e7f363b2cd68cde064 \
+ sha256 23910f5277ceb43398442074e444182941bf7f6da85efd84ecdd0cf62c4b8935
+
</ins><span class="cx"> depends_run port:gd2 \
</span><del>- port:adodb
</del><ins>+ port:adodb \
+ port:pear-Mail port:pear-Mail_Mime port:pear-Image_Graph \
+ port:pear-Image_Canvas port:pear-Image_Color port:pear-Numbers_Roman
</ins><span class="cx">
</span><ins>+## http://sourceforge.net/p/secureideas/patches/27/
+## +mysql support through mysqli extension
+patchfiles patch-base.diff
+
</ins><span class="cx"> use_configure no
</span><span class="cx"> build {}
</span><span class="cx">
</span><span class="lines">@@ -26,15 +36,28 @@
</span><span class="cx">
</span><span class="cx"> destroot {
</span><span class="cx"> xinstall -m 755 -d ${destroot}${basedir}
</span><del>- xinstall -m 755 -d ${destroot}${docsdir}
- system "cd ${worksrcpath} && cp -R . ${destroot}${basedir}"
- system "cd ${worksrcpath}/docs/ && cp -R . ${destroot}${docsdir}"
</del><ins>+
+ foreach file [glob -directory ${worksrcpath}/ *] {
+ copy ${file} ${destroot}${basedir}/
+ }
+
+ reinplace "s|\$DBlib_path = '';|\$DBlib_path = '${prefix}/share/adodb5';|g" ${destroot}${basedir}/base_conf.php.dist
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> post-activate {
</span><del>-ui_msg "\n
-Make sure to customize ${prefix}/share/base/base_conf.php.dist
-\n"
</del><ins>+ ## Not sure if needed. If the file exists, wizard says you need to delete it
+ if ![file exists ${basedir}/base_conf.php ] {
+ copy ${basedir}/base_conf.php.dist ${basedir}/base_conf.php
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+notes "
+Read the files under ${prefix}/share/base/docs, especially README and INSTALL.
+
+Note that this software is installed under ${prefix}/share/base
+
+This version was released in 2010 and the authors consider it BETA;
+you may want to consider other software options.
+"
+
</ins><span class="cx"> livecheck.regex ${name}-(\[0-9.\]+)${extract.suffix}
</span></span></pre></div>
<a id="trunkdportssecuritybasefilespatchbasediff"></a>
<div class="addfile"><h4>Added: trunk/dports/security/base/files/patch-base.diff (0 => 128368)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/security/base/files/patch-base.diff         (rev 0)
+++ trunk/dports/security/base/files/patch-base.diff        2014-11-20 03:49:03 UTC (rev 128368)
</span><span class="lines">@@ -0,0 +1,450 @@
</span><ins>+diff -urN ../base-1.4.5.orig/base_db_common.php ./base_db_common.php
+--- ../base-1.4.5.orig/base_db_common.php        2010-03-05 10:06:16.000000000 -0500
++++ ./base_db_common.php        2014-03-12 15:00:22.000000000 -0400
+@@ -80,7 +80,7 @@
+ " "._ERRPHPERROR2."</FONT>";
+ }
+
+- if ( ($DBtype == "mysql") || ($DBtype == "mysqlt") )
++ if ( ($DBtype == "mysql") || ($DBtype == "mysqlt") || ($DBtype == "mysqli"))
+ {
+ if ( !(function_exists("mysql_connect")) )
+ {
+diff -urN ../base-1.4.5.orig/base_graph_display.php ./base_graph_display.php
+--- ../base-1.4.5.orig/base_graph_display.php        2010-03-05 10:06:17.000000000 -0500
++++ ./base_graph_display.php        2014-03-12 14:59:57.000000000 -0400
+@@ -114,7 +114,7 @@
+ else
+ {
+ // Create the graph area, legends on bottom -- Alejandro
+- $Graph =& new Image_Graph(array('driver'=>'gd',
++ $Graph = new Image_Graph(array('driver'=>'gd',
+ 'width'=>$width,
+ 'height'=>$height));
+ }
+@@ -320,27 +320,27 @@
+
+ // special case '"I0" => "private network (rfc 1918)"' and
+ // '"** (private network) " => "private network (rfc 1918)"'
+- if (ereg("rfc 1918", $tmp, $substring) || (ereg("[*][*] \(private network\) ", $tmp_lower, $substring)))
++ if (preg_match("/rfc 1918/", $tmp, $substring) || (preg_match("/[*][*] \(private network\) /", $tmp_lower, $substring)))
+ {
+ $Dataset->addPoint("private network (rfc 1918)", $xdata[$i][1]);
+ }
+ // special case '?? (Not Found) ' => 'unknown'
+- elseif(ereg("[?][?][ \t]+\(Not Found\)[ \t]*", $tmp, $substring))
++ elseif(preg_match("/[?][?][ \t]+\(Not Found\)[ \t]*/", $tmp, $substring))
+ {
+ $Dataset->addPoint("unknown", $xdata[$i][1]);
+ }
+ // anything inside parentheses, following a 2-letter TLD:
+- elseif (ereg("^[-a-zA-Z0-9]{2}[ \t]\((.+)\)[ \t]*$", $tmp, $substring))
++ elseif (preg_match("/^[-a-zA-Z0-9]{2}[ \t]\((.+)\)[ \t]*$/", $tmp, $substring))
+ {
+ $Dataset->addPoint($substring[1], $xdata[$i][1]);
+ }
+ // anything after two-letter top level domain names and after one space or tab:
+- elseif (ereg("[ \t]*[-a-zA-Z0-9]{2}[ \t]([-a-zA-Z0-9]+[-a-zA-Z0-9 ]*)", $tmp, $substring))
++ elseif (preg_match("/[ \t]*[-a-zA-Z0-9]{2}[ \t]([-a-zA-Z0-9]+[-a-zA-Z0-9 ]*)/", $tmp, $substring))
+ {
+ $Dataset->addPoint($substring[1], $xdata[$i][1]);
+ }
+ // two-letter top level domain names right at the beginning:
+- elseif (ereg("[ \t]*([-a-zA-Z0-9]{2})[ \t]", $tmp_lower, $substring))
++ elseif (preg_match("/[ \t]*([-a-zA-Z0-9]{2})[ \t]/", $tmp_lower, $substring))
+ {
+ $Dataset->addPoint($substring[1], $xdata[$i][1]);
+ }
+diff -urN ../base-1.4.5.orig/base_qry_common.php ./base_qry_common.php
+--- ../base-1.4.5.orig/base_qry_common.php        2010-03-05 10:06:17.000000000 -0500
++++ ./base_qry_common.php        2014-03-12 14:59:53.000000000 -0400
+@@ -773,10 +773,10 @@
+ }
+ }
+ /* if have chosen the address type to be both source and destination */
+- if ( ereg("ip_both", $tmp) )
++ if ( preg_match("/ip_both/", $tmp) )
+ {
+- $tmp_src = ereg_replace("ip_both","ip_src",$tmp);
+- $tmp_dst = ereg_replace("ip_both","ip_dst",$tmp);
++ $tmp_src = preg_replace("/ip_both/","ip_src",$tmp);
++ $tmp_dst = preg_replace("/ip_both/","ip_dst",$tmp);
+
+ if ( $ip_addr[$i][2] == '=' )
+ $tmp = "(".$tmp_src.') OR ('.$tmp_dst.')';
+diff -urN ../base-1.4.5.orig/base_qry_sqlcalls.php ./base_qry_sqlcalls.php
+--- ../base-1.4.5.orig/base_qry_sqlcalls.php        2010-03-05 10:06:17.000000000 -0500
++++ ./base_qry_sqlcalls.php        2014-03-12 14:59:53.000000000 -0400
+@@ -259,9 +259,9 @@
+ $line = split (" ", $current_sig_txt);
+ foreach ($line as $ps_element)
+ {
+- if ( ereg("[0-9]*\.[0-9]*\.[0-9]*\.[0-9]", $ps_element) )
++ if ( preg_match("/[0-9]*\.[0-9]*\.[0-9]*\.[0-9]/", $ps_element) )
+ {
+- $ps_element = ereg_replace (":", "", $ps_element);
++ $ps_element = preg_replace ("/:/", "", $ps_element);
+ qroPrintEntry("<A HREF=\"base_stat_ipaddr.php?ip=".$ps_element."&amp;netmask=32\">".
+ $ps_element."</A>");
+ }
+diff -urN ../base-1.4.5.orig/base_stat_common.php ./base_stat_common.php
+--- ../base-1.4.5.orig/base_stat_common.php        2010-03-05 10:06:17.000000000 -0500
++++ ./base_stat_common.php        2014-03-12 15:00:16.000000000 -0400
+@@ -312,7 +312,7 @@
+ if (!stristr($where, "WHERE") && $where != "")
+         $where = " WHERE $where ";
+
+- if ( $db->DB_type == "mysql" )
++ if ( $db->DB_type == "mysql" || $db->DB_type == "mysqli" )
+ {
+ if ( $join == "" && $where == "")
+ $result = $db->baseExecute("SELECT COUNT(DISTINCT acid_event.ip_src, acid_event.ip_dst, acid_event.ip_proto) FROM acid_event");
+diff -urN ../base-1.4.5.orig/base_stat_ipaddr.php ./base_stat_ipaddr.php
+--- ../base-1.4.5.orig/base_stat_ipaddr.php        2010-03-05 10:06:17.000000000 -0500
++++ ./base_stat_ipaddr.php        2014-03-12 14:59:53.000000000 -0400
+@@ -135,7 +135,7 @@
+ print "</PRE><BR>\n";
+ */
+
+- if(ereg($ip, $contents)) {
++ if(preg_match("/$ip/", $contents)) {
+ $total++;
+ if( $total % 2 == 0 ) {
+ $color="DDDDDD";
+@@ -143,7 +143,7 @@
+ $color="FFFFFF";
+ }
+
+- $contents = ereg_replace(" ", " ", $contents);
++ $contents = preg_replace("/ /", " ", $contents);
+ $elements = explode(" ", $contents);
+
+ echo '<tr bgcolor="'.$color.'"><td align="center">'.
+@@ -183,7 +183,7 @@
+ print "</PRE></TD>";
+
+ /*
+- ereg("([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*):([0-9]*)",$elements[3],$store);
++ preg_match("/([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*):([0-9]*)/",$elements[3],$store);
+ $source_ip = $store[1];
+ $source_port = $store[2];
+ if (empty($source_ip))
+@@ -197,7 +197,7 @@
+ echo '<td align="center">' . $source_ip . '</td>';
+ echo '<td align="center">' . $source_port . '</td>';
+
+- ereg("([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*):([0-9]*)",$elements[5],$store);
++ preg_match("/([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*):([0-9]*)/",$elements[5],$store);
+ $destination_ip = $store[1];
+ $destination_port = $store[2];
+ if (empty($destination_ip))
+diff -urN ../base-1.4.5.orig/includes/base_db.inc.php ./includes/base_db.inc.php
+--- ../base-1.4.5.orig/includes/base_db.inc.php        2010-03-05 10:06:18.000000000 -0500
++++ ./includes/base_db.inc.php        2014-03-12 15:00:09.000000000 -0400
+@@ -77,7 +77,16 @@
+ {
+ GLOBAL $sql_trace_mode, $sql_trace_file;
+
+- $this->DB = NewADOConnection();
++ // If they have mysqli, use it. Otherwise, fall back to the older "mysql" extension.
++ if ($this->DB_type == 'mysql') {
++ if (extension_loaded('mysqli')) {
++ $this->DB_type = 'mysqli';
++ } else {
++ $this->DB_type = 'mysql';
++         }
++ }
++
++ $this->DB = NewADOConnection($this->DB_type);
+ $this->DB_name = $database;
+ $this->DB_host = $host;
+ $this->DB_port = $port;
+@@ -108,7 +117,7 @@
+
+ /* Set the database schema version number */
+ $sql = "SELECT vseq FROM schema";
+- if ($this->DB_type == "mysql") $sql = "SELECT vseq FROM `schema`";
++ if ($this->DB_type == "mysql" || $this->DB_type == "mysqli") $sql = "SELECT vseq FROM `schema`";
+ if ($this->DB_type == "mssql") $sql = "SELECT vseq FROM [schema]";
+
+ $result = $this->DB->Execute($sql);
+@@ -138,8 +147,17 @@
+ function basePConnect($database, $host, $port, $username, $password)
+ {
+ GLOBAL $sql_trace_mode, $sql_trace_file;
++
++ // If they have mysqli, use it. Otherwise, fall back to the older "mysql" extension.
++ if ($this->DB_type == 'mysql') {
++ if (extension_loaded('mysqli')) {
++ $this->DB_type = 'mysqli';
++ } else {
++ $this->DB_type = 'mysql';
++         }
++ }
+
+- $this->DB = NewADOConnection();
++ $this->DB = NewADOConnection($this->DB_type);
+ $this->DB_name = $database;
+ $this->DB_host = $host;
+ $this->DB_port = $port;
+@@ -171,7 +189,7 @@
+ /* Set the database schema version number */
+ $sql = "SELECT vseq FROM schema";
+ if ($this->DB_type == "mssql") $sql = "SELECT vseq FROM [schema]";
+- if ($this->DB_type == "mysql") $sql = "SELECT vseq FROM `schema`";
++ if ($this->DB_type == "mysql" || $this->DB_type == "mysqli") $sql = "SELECT vseq FROM `schema`";
+
+ $result = $this->DB->Execute($sql);
+ if ( $this->baseErrorMessage() != "" )
+@@ -209,7 +227,7 @@
+ /* ** Begin DB specific SQL fix-up ** */
+ if ($this->DB_type == "mssql")
+ {
+- $sql = eregi_replace("''", "NULL", $sql);
++ $sql = preg_replace("/''/i", "NULL", $sql);
+ }
+
+ if ($this->DB_type == "oci8")
+@@ -231,7 +249,7 @@
+ $rs = new baseRS($this->DB->Execute($sql), $this->DB_type);
+ else
+ {
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") ||
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") ||
+ ($this->DB_type == "maxsql") )
+ {
+ $rs = new baseRS($this->DB->Execute($sql." LIMIT ".$start_row.", ".$num_rows),
+@@ -321,7 +339,7 @@
+ * the current point, so it can't be here and needs to be in the actual script after calling this function
+ * -- srh (02/01/2001)
+ */
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") ||
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") ||
+ ($this->DB_type == "maxsql") || ($this->DB_type == "mssql"))
+ return $this->DB->Insert_ID();
+ else if ($this->DB_type == "postgres" ||($this->DB_type == "oci8"))
+@@ -336,7 +354,7 @@
+
+ function baseSQL_YEAR($func_param, $op, $timestamp)
+ {
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") ||
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") ||
+ ($this->DB_type == "maxsql") || ($this->DB_type == "mssql") )
+ return " YEAR($func_param) $op $timestamp ";
+ else if( $this->DB_type == "oci8" )
+@@ -347,7 +365,7 @@
+
+ function baseSQL_MONTH($func_param, $op, $timestamp)
+ {
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") ||
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") ||
+ ($this->DB_type == "maxsql") || ($this->DB_type == "mssql") )
+ return " MONTH($func_param) $op $timestamp ";
+ else if( $this->DB_type == "oci8" )
+@@ -358,7 +376,7 @@
+
+ function baseSQL_DAY($func_param, $op, $timestamp)
+ {
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "maxsql") )
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") || ($this->DB_type == "maxsql") )
+ return " DAYOFMONTH($func_param) $op $timestamp ";
+ else if($this->DB_type == "oci8")
+ return " to_number( to_char( $func_param, 'DD' ) ) $op $timestamp ";
+@@ -370,7 +388,7 @@
+
+ function baseSQL_HOUR($func_param, $op, $timestamp)
+ {
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "maxsql") )
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") || ($this->DB_type == "maxsql") )
+ return " HOUR($func_param) $op $timestamp ";
+ else if($this->DB_type == "oci8")
+ return " to_number( to_char( $func_param, 'HH' ) ) $op $timestamp ";
+@@ -382,7 +400,7 @@
+
+ function baseSQL_MINUTE($func_param, $op, $timestamp)
+ {
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "maxsql") )
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") || ($this->DB_type == "maxsql") )
+ return " MINUTE($func_param) $op $timestamp ";
+ else if($this->DB_type == "oci8")
+ return " to_number( to_char( $func_param, 'MI' ) ) $op $timestamp ";
+@@ -394,7 +412,7 @@
+
+ function baseSQL_SECOND($func_param, $op, $timestamp)
+ {
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "maxsql") )
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") || ($this->DB_type == "maxsql") )
+ return " SECOND($func_param) $op $timestamp ";
+ else if($this->DB_type == "oci8")
+ return " to_number( to_char( $func_param, 'SS' ) ) $op $timestamp ";
+@@ -406,7 +424,7 @@
+
+ function baseSQL_UNIXTIME($func_param, $op, $timestamp)
+ {
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "maxsql") )
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") || ($this->DB_type == "maxsql") )
+ {
+ return " UNIX_TIMESTAMP($func_param) $op $timestamp ";
+ }
+@@ -432,7 +450,7 @@
+
+ function baseSQL_TIMESEC($func_param, $op, $timestamp)
+ {
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "maxsql") )
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") || ($this->DB_type == "maxsql") )
+ return " TIME_TO_SEC($func_param) $op $timestamp ";
+ else if($this->DB_type == "oci8")
+ return " to_number( $func_param ) $op $timestamp ";
+@@ -549,7 +567,7 @@
+
+ // Is This if statement necessary? -- Kevin
+ /* MS SQL Server 7, MySQL, Sybase, and Postgres natively support this function */
+- if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "maxsql") ||
++ if ( ($this->DB_type == "mysql") || ($this->DB_type == "mysqlt") || ($this->DB_type == "mysqli") || ($this->DB_type == "maxsql") ||
+ ($this->DB_type == "mssql") || ($this->DB_type == "sybase") || ($this->DB_type == "postgres") || ($this->DB_type == "oci8"))
+ return $this->row->RecordCount();
+
+@@ -623,6 +641,7 @@
+ if ( !(
+ ($type == "mysql") ||
+          ($type == "mysqlt") ||
++         ($type == "mysqli") ||
+          ($type == "maxsql") ||
+ ($type == "postgres") ||
+          ($type == "mssql") ||
+diff -urN ../base-1.4.5.orig/includes/base_net.inc.php ./includes/base_net.inc.php
+--- ../base-1.4.5.orig/includes/base_net.inc.php        2010-03-05 10:06:18.000000000 -0500
++++ ./includes/base_net.inc.php        2014-03-12 14:59:53.000000000 -0400
+@@ -391,7 +391,7 @@
+ $line = explode(" ", $response_l[$i]);
+ for ($j=0; $j < sizeof($line); $j++ )
+ {
+- if ( eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $line[$j]) )
++ if ( preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", $line[$j]) )
+ {
+ if ( $email == "" )
+ $email = $line[$j];
+diff -urN ../base-1.4.5.orig/includes/base_signature.inc.php ./includes/base_signature.inc.php
+--- ../base-1.4.5.orig/includes/base_signature.inc.php        2010-03-05 10:06:18.000000000 -0500
++++ ./includes/base_signature.inc.php        2014-03-12 14:59:53.000000000 -0400
+@@ -139,7 +139,7 @@
+ {
+ if ($tmp_ref_system_name == "snort")
+ {
+- if (ereg("([0-9]+):([0-9]+)", $ref_tag, $backref))
++ if (preg_match("/([0-9]+):([0-9]+)/", $ref_tag, $backref))
+ {
+ if ($backref[1] == "1")
+ {
+diff -urN ../base-1.4.5.orig/includes/base_state_citems.inc.php ./includes/base_state_citems.inc.php
+--- ../base-1.4.5.orig/includes/base_state_citems.inc.php        2010-03-05 10:06:18.000000000 -0500
++++ ./includes/base_state_citems.inc.php        2014-03-12 14:59:53.000000000 -0400
+@@ -963,7 +963,7 @@
+ for ( $i = 0; $i < $this->criteria_cnt; $i++ )
+ {
+ if ( (isset ($this->criteria[$i][3])) &&
+- (ereg("([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)", $this->criteria[$i][3])) )
++ (preg_match("/([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)/", $this->criteria[$i][3])) )
+ {
+ $tmp_ip_str = $this->criteria[$i][7] = $this->criteria[$i][3];
+ $this->criteria[$i][3] = strtok($tmp_ip_str, ".");
+diff -urN ../base-1.4.5.orig/includes/base_state_common.inc.php ./includes/base_state_common.inc.php
+--- ../base-1.4.5.orig/includes/base_state_common.inc.php        2010-03-05 10:06:18.000000000 -0500
++++ ./includes/base_state_common.inc.php        2014-03-12 14:59:53.000000000 -0400
+@@ -181,7 +181,7 @@
+ if ( ($valid_data & VAR_SCORE) > 0 )
+ $regex_mask = $regex_mask . "\-";
+
+- return ereg_replace("[^".$regex_mask."]", "", $item);
++ return preg_replace("/[^".$regex_mask."]/", "", $item);
+ }
+
+ /* ***********************************************************************
+diff -urN ../base-1.4.5.orig/includes/base_state_criteria.inc.php ./includes/base_state_criteria.inc.php
+--- ../base-1.4.5.orig/includes/base_state_criteria.inc.php        2010-03-05 10:06:18.000000000 -0500
++++ ./includes/base_state_criteria.inc.php        2014-03-12 14:59:53.000000000 -0400
+@@ -252,7 +252,7 @@
+ if ( isset($_POST['current_view']) ) $query_string .= "&amp;current_view=".$_POST['current_view'];
+ if ( isset($_POST['submit']) ) $query_string .= "&amp;submit=".$_POST['submit'];
+
+- $query_string = ereg_replace("back=1&", "", CleanVariable($query_string, VAR_PERIOD | VAR_DIGIT | VAR_PUNC | VAR_LETTER));
++ $query_string = preg_replace("/back=1&/", "", CleanVariable($query_string, VAR_PERIOD | VAR_DIGIT | VAR_PUNC | VAR_LETTER));
+
+ ++$_SESSION['back_list_cnt'];
+ $_SESSION['back_list'][$_SESSION['back_list_cnt']] =
+diff -urN ../base-1.4.5.orig/setup/setup2.php ./setup/setup2.php
+--- ../base-1.4.5.orig/setup/setup2.php        2010-03-05 10:06:18.000000000 -0500
++++ ./setup/setup2.php        2014-03-12 15:00:05.000000000 -0400
+@@ -68,6 +68,15 @@
+ $arcdbpasswd = ImportHTTPVar("arcdbpasswd");
+ $arcdbname = ImportHTTPVar("arcdbname", VAR_ALPHA | VAR_SCORE | VAR_USCORE);
+
++ // If they have mysqli, use it. Otherwise, fall back to the older "mysql" extension.
++ if ($dbtype == 'mysql') {
++ if (extension_loaded('mysqli')) {
++ $dbtype = 'mysqli';
++ } else {
++ $dbtype = 'mysql';
++ }
++ }
++
+ $db = NewADOConnection($dbtype);
+ $dbconnect = $db->Connect( ( ( $dbport == "") ? $dbhost : ($dbhost.":".$dbport) ),
+ $dbusername, $dbpasswd, $dbname);
+diff -urN ../base-1.4.5.orig/setup/setup_db.inc.php ./setup/setup_db.inc.php
+--- ../base-1.4.5.orig/setup/setup_db.inc.php        2010-03-05 10:06:18.000000000 -0500
++++ ./setup/setup_db.inc.php        2014-03-12 15:00:01.000000000 -0400
+@@ -45,7 +45,7 @@
+ }
+
+ if ( !$tblBaseAG_present ) {
+- if ( $db->DB_type == "mysql" ) {
++ if ( $db->DB_type == "mysql" || $db->DB_type == "mysqli") {
+ $sql = 'CREATE TABLE acid_ag ( ag_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ ag_name VARCHAR(40),
+ ag_desc TEXT,
+@@ -114,7 +114,7 @@
+ }
+
+ if ( !$tblBaseAGAlert_present ) {
+- if ( $db->DB_type == "mysql" ) {
++ if ( $db->DB_type == "mysql" || $db->DB_type == "mysqli") {
+ $sql = 'CREATE TABLE acid_ag_alert( ag_id INT UNSIGNED NOT NULL,
+ ag_sid INT UNSIGNED NOT NULL,
+ ag_cid INT UNSIGNED NOT NULL,
+@@ -151,7 +151,7 @@
+ }
+
+ if ( !$tblBaseIPCache_present ) {
+- if ( $db->DB_type == "mysql" ) {
++ if ( $db->DB_type == "mysql" || $db->DB_type == "mysqli") {
+ $sql = 'CREATE TABLE acid_ip_cache( ipc_ip INT UNSIGNED NOT NULL,
+ ipc_fqdn VARCHAR(50),
+ ipc_dns_timestamp DATETIME,
+@@ -193,7 +193,7 @@
+ }
+
+ if ( !$tblBaseEvent_present ) {
+- if ( $db->DB_type == "mysql" ) {
++ if ( $db->DB_type == "mysql" || $db->DB_type == "mysqli") {
+ if ( $db->baseGetDBversion() < 100 )
+ $sig_ddl = "signature VARCHAR(255) NOT NULL,";
+ else
+@@ -319,7 +319,7 @@
+
+ /* Added for base_roles and base_users -- Kevin */
+ if ( !$tblBaseRoles_present ) {
+- if ( $db->DB_type == "mysql" ) {
++ if ( $db->DB_type == "mysql" || $db->DB_type == "mysqli") {
+ $sql = 'CREATE TABLE base_roles ( role_id int(11) NOT NULL,
+ role_name varchar(20) NOT NULL,
+ role_desc varchar(75) NOT NULL,
+@@ -385,7 +385,7 @@
+ }
+
+ if ( !$tblBaseUsers_present ) {
+- if ( $db->DB_type == "mysql" ) {
++ if ( $db->DB_type == "mysql" || $db->DB_type == "mysqli") {
+ $sql = 'CREATE TABLE base_users ( usr_id int(11) NOT NULL,
+ usr_login varchar(25) NOT NULL,
+ usr_pwd varchar(32) NOT NULL,
</ins></span></pre>
</div>
</div>
</body>
</html>