Arpwatch PHP error



  • I'm not sure if this is the right place to put this but here goes:

    My pfsense version:

    2.1-BETA0 (amd64)
    built on Tue Nov 6 00:59:52 EST 2012
    FreeBSD pfsense 8.3-RELEASE-p4 FreeBSD 8.3-RELEASE-p4 #1: Tue Nov 6 01:30:39 EST 2012 root@snapshots-8_3-amd64.builders.pfsense.org:/usr/obj./usr/pfSensesrc/src/sys/pfSense_SMP.8 amd64
    

    arpwatch (at least for AMD64) seems to run fine and reports are generated into the reports tab.

    I discovered a php error on the reports page, when you hit the "Clear Log" button you get a blank page with only:

    Fatal error: Call to undefined function stop_service() in /usr/local/www/arpwatch_reports.php on line 37

    when you get back to the index.php there is now a crash report:

    "pfSense has detected a crash report or programming bug. Click here for more information."

    here is the contents of the crash report:

    Crash report begins.  Anonymous machine information:
    
    amd64
    8.3-RELEASE-p4
    FreeBSD 8.3-RELEASE-p4 #1: Tue Nov  6 01:30:39 EST 2012     root@snapshots-8_3-amd64.builders.pfsense.org:/usr/obj./usr/pfSensesrc/src/sys/pfSense_SMP.8
    
    Crash report details:
    
    PHP Errors:
    [06-Nov-2012 14:04:33 UTC] PHP Fatal error:  Call to undefined function stop_service() in /usr/local/www/arpwatch_reports.php on line 37
    
    

    I solved this by adding the below line to /usr/local/www/arpwatch_reports.php

    require_once("service-utils.inc");
    

    here is a patch:

    *** /usr/local/www/arpwatch_reports.php Tue Nov  6 08:57:01 2012
    --- arpwatch_reports.php        Tue Nov  6 09:18:30 2012
    ***************
    *** 28,37 ****
    --- 28,38 ----
              ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
              POSSIBILITY OF SUCH DAMAGE.
      */
    
      require("guiconfig.inc");
    + require_once("service-utils.inc");
    
      $logfile = "/var/log/arp.dat";
    
      if ($_POST['clear']) {
              stop_service("arpwatch");
    

  • Rebel Alliance Developer Netgate

    I committed that fix, should be up shortly (but I didn't do a version bump)



  • hey JimP i just tried this again ( https://pfsense-ip/arpwatch_reports.php –> click "clear log" button" --> get php error )

    I still get the error as of today's build:

    2.1-BETA0 (amd64)
    built on Wed Nov 28 10:58:00 EST 2012
    FreeBSD 8.3-RELEASE-p5

    I have also tried to uninstall the arpwatch package and reinstall it, same effect.

    Fatal error: Call to undefined function stop_service() in /usr/local/www/arpwatch_reports.php on line 37

    Should this be fixed by now?  I know this is not a big deal, I just figure that you forgot about it and I like to feel like I am contributing wherever my limited skills allow me.


  • Rebel Alliance Developer Netgate

    I remember committing it but it must not have been pushed back to the repo. I can't find any trace of it here. I did it again and confirmed that it pushed this time.


Locked