Accepting request 789671 from server:monitoring

OBS-URL: https://build.opensuse.org/request/show/789671
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/pmacct?expand=0&rev=6
This commit is contained in:
Dominique Leuenberger 2020-03-30 21:03:58 +00:00 committed by Git OBS Bridge
commit 4b7fea3de9
3 changed files with 38 additions and 1 deletions

29
pmacct-fix-overflow.patch Normal file
View File

@ -0,0 +1,29 @@
Index: pmacct-1.7.4/src/sfacctd.c
===================================================================
--- pmacct-1.7.4.orig/src/sfacctd.c
+++ pmacct-1.7.4/src/sfacctd.c
@@ -2045,7 +2045,7 @@ void finalizeSample(SFSample *sample, st
int SF_find_id(struct id_table *t, struct packet_ptrs *pptrs, pm_id_t *tag, pm_id_t *tag2)
{
- struct sockaddr sa_local;
+ struct sockaddr_storage sa_local;
struct sockaddr_in *sa4 = (struct sockaddr_in *) &sa_local;
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *) &sa_local;
SFSample *sample = (SFSample *)pptrs->f_data;
@@ -2086,13 +2086,13 @@ int SF_find_id(struct id_table *t, struc
if (sample->agent_addr.type == SFLADDRESSTYPE_IP_V4) {
begin = 0;
end = t->ipv4_num;
- sa_local.sa_family = AF_INET;
+ sa_local.ss_family = AF_INET;
sa4->sin_addr.s_addr = sample->agent_addr.address.ip_v4.s_addr;
}
else if (sample->agent_addr.type == SFLADDRESSTYPE_IP_V6) {
begin = t->num-t->ipv6_num;
end = t->num;
- sa_local.sa_family = AF_INET6;
+ sa_local.ss_family = AF_INET6;
memcpy(sa6->sin6_addr.s6_addr, sample->agent_addr.address.ip_v6.s6_addr, 16);
}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Mar 30 07:47:03 UTC 2020 - Marcus Meissner <meissner@suse.com>
- pmacct-fix-overflow.patch: fixed bufferoverflow in sfacctd.
- reenable _FORTIFY_SOURCE that showed that failure
-------------------------------------------------------------------
Sun Feb 9 10:02:46 UTC 2020 - Martin Hauke <mardnh@gmx.de>

View File

@ -41,6 +41,7 @@ Source10: nfacctd.conf
Source11: pmacctd.conf
Source12: sfacctd.conf
Source20: pmacct.1
Patch0: pmacct-fix-overflow.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libmysqlclient-devel
@ -73,13 +74,14 @@ export data to tools like RRDtool, GNUPlot, Net-SNMP, MRTG, and Cacti.
%prep
%setup -q -n %{name}-1.7.4
%patch0 -p1
# fix permissions
chmod -x sql/pmacct-*
%build
autoreconf -fiv
export CFLAGS="%{optflags} -Wno-return-type -D_FORTIFY_SOURCE=0"
export CFLAGS="%{optflags} -Wno-return-type"
%configure \
--sysconfdir=%{_sysconfdir}/%{name} \
--docdir="%{_docdir}/%{name}" \