Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2013 09:16:37 -0800
From:      birch <birch@naturalpoint.com>
To:        itetcu@FreeBSD.org
Cc:        ports@FreeBSD.org
Subject:   Re: FreeBSD apcupsd port - patch for APC 9606 SNMP cards
Message-ID:  <5123B375.30307@naturalpoint.com>
In-Reply-To: <500844D0.2040708@naturalpoint.com>
References:  <500844D0.2040708@naturalpoint.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello again,

Just did an upgrade to FreeBSD 9.1 and I noticed that the apcupsd port 
still has this crash and requires the patch. It would be fantastic if 
the patch below could be integrated into the port for those of us who 
are using 9606 SNMP cards.

Also adding a CC to ports@FreeBSD.org in case the email address for the 
port maintainer is not being checked.

Many thanks!

birch



--- sysutils/apcupsd/work/apcupsd-3.14.10/src/drivers/snmplite/apc-mib.cpp
+++ sysutils/apcupsd/work/apcupsd-3.14.10/src/drivers/snmplite/apc-mib.cpp
@@ -307,6 +307,8 @@
        break;

     case CI_Overload:
+      if (data.str.len() < 9)
+         break;
        Dmsg1(80, "Got CI_Overload: %c\n", data.str[8]);
        if (data.str[8] == '1')
           ups->set_overload();



birch wrote on 7/19/2012 10:33 AM:
> Hello,
>
> The current version of apcupsd in the ports tree for FreeBSD 8.3 no
> longer works with APC ups's connected via APC 9606 SNMP cards. Would it
> be possible to get the following patch added to the port, and/or passed
> upstream?
>
>
> The link below describes the problem and fix in more detail, I have
> included their patch in this email. I have verified that this patch
> fixes resolves the issue on FreeBSD 8.3 and allows apcupsd to run
> without crashing on startup.
>
>
> Thank you,
> birch
>
> "Debian Bug report logs - #655741"
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655741
>
>
> Here is the patch as I tested it :
>
> --- sysutils/apcupsd/work/apcupsd-3.14.10/src/drivers/snmplite/apc-mib.cpp
> +++ sysutils/apcupsd/work/apcupsd-3.14.10/src/drivers/snmplite/apc-mib.cpp
> @@ -307,6 +307,8 @@
>         break;
>
>      case CI_Overload:
> +      if (data.str.len() < 9)
> +         break;
>         Dmsg1(80, "Got CI_Overload: %c\n", data.str[8]);
>         if (data.str[8] == '1')
>            ups->set_overload();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5123B375.30307>