+++ /dev/null
-From 9b320138755542b927df650da0bd1e61ecaa41d7 Mon Sep 17 00:00:00 2001
-Message-Id: <9b320138755542b927df650da0bd1e61ecaa41d7.1378117677.git.npajkovs@redhat.com>
-From: Vitezslav Samel <vitezslav@samel.cz>
-Date: Thu, 29 Aug 2013 10:11:42 +0200
-Subject: [PATCH] BUGFIX: fix "Floating point exception" in
- tcplog_flowrate_msg()
-
-commit 0d55bee "tcplog_flowrate_msg(): cleanup and fix") removed
-condition, which leads to zero division.
-
-Time diff between current time and ->conn_starttime is 0, because of
-rate_print updates happen in less then 1 sec and later on, we try to
-divide ->bcount by interval, which is 0, hencs zero division.
-
-Reported-by: Erik K. <ummeegge@ipfire.org>
-Signed-off-by: Vitezslav Samel <vitezslav@samel.cz>
-Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
----
- src/tcptable.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/tcptable.c b/src/tcptable.c
-index a4133d9..e217b19 100644
---- a/src/tcptable.c
-+++ b/src/tcptable.c
-@@ -437,6 +437,8 @@ static char *tcplog_flowrate_msg(struct tcptableent *entry, char *buf,
- size_t bufsize)
- {
- time_t interval = time(NULL) - entry->conn_starttime;
-+ if (interval < 1)
-+ interval = 1;
-
- char rbuf[64];
- rate_print(entry->bcount / interval, rbuf, sizeof(rbuf));
---
-1.8.1.2
-
+++ /dev/null
---- iptraf-ng-1.1.3.1/src/ipfilter.c.formatsec 2013-02-05 13:57:52.461008094 +0100
-+++ iptraf-ng-1.1.3.1/src/ipfilter.c 2013-02-05 13:58:17.100874609 +0100
-@@ -136,7 +136,7 @@ void gethostparams(struct hostparams *da
- snprintf(msgstr, 60,
- "Invalid protocol input at or near token \"%s\"",
- bptr);
-- tui_error(ANYKEY_MSG, msgstr);
-+ tui_error(ANYKEY_MSG, "%s", msgstr);
- doagain = 1;
- } else
- doagain = 0;
---- iptraf-ng-1.1.3.1/src/othptab.c.formatsec 2013-02-05 14:02:18.220828537 +0100
-+++ iptraf-ng-1.1.3.1/src/othptab.c 2013-02-05 14:09:36.732870661 +0100
-@@ -430,7 +430,7 @@ void printothpentry(struct othptable *ta
- break;
- }
-
-- sprintf(scratchpad, rarp_mac_addr);
-+ sprintf(scratchpad, "%s", rarp_mac_addr);
- strcat(msgstring, scratchpad);
- wattrset(table->othpwin, ARPATTR);
- break;
-@@ -505,7 +505,7 @@ void printothpentry(struct othptable *ta
- wattrset(table->othpwin, UNKNIPATTR);
- protptr = getprotobynumber(entry->protocol);
- if (protptr != NULL) {
-- sprintf(protname, protptr->p_aliases[0]);
-+ sprintf(protname, "%s", protptr->p_aliases[0]);
- } else {
- sprintf(protname, "IP protocol");
- unknown = 1;
Summary(ru.UTF-8): IPTraf - консольная программа мониторинга сетевого траффика
Summary(uk.UTF-8): IPTraf - консольна програма моніторингу трафіку в мережі
Name: iptraf-ng
-Version: 1.1.4
-Release: 2
+Version: 1.2.1
+Release: 1
License: GPL
Group: Networking/Utilities
-Source0: https://fedorahosted.org/releases/i/p/iptraf-ng/%{name}-%{version}.tar.gz
-# Source0-md5: de27cfeeede96e2acfb0edc8439b034a
-Patch0: %{name}-format-security.patch
-Patch1: 0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch
-URL: https://fedorahosted.org/iptraf-ng/
+Source0: https://github.com/iptraf-ng/iptraf-ng/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 3e6b425e21c7dc5df35b40799cbfe7dd
+URL: https://github.com/iptraf-ng/iptraf-ng/
+BuildRequires: docbook-dtd41-sgml
+BuildRequires: docbook-utils
+BuildRequires: ncurses-devel
BuildRequires: ncurses-ext-devel >= 5.4
Obsoletes: iptraf
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
конкретних комп'ютерах. IPTraf працює з інтерфейсами Ethernet та
SLIP/PPP.
-%define _bindir %{_sbindir}
%prep
%setup -q
-%patch0 -p1
-%patch1 -p1
%build
-%configure \
- CPPFLAGS="-I/usr/include/ncurses"
-%{__make} V=1
+%{__make} \
+ CC="%{__cc}" \
+ CPPFLAGS="%{rpmcppflags}" \
+ CFLAGS="%{rpmcflags}" \
+ LDFLAGS="%{rpmldflags}" \
+ V=1
+
+%{__make} html
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT \
- V=1
+ V=1 \
+ prefix="%{_prefix}" \
+ localedir="%{_localedir}" \
+ mandir="%{_mandir}" \
+ sbindir="%{_sbindir}" \
+ sharedir="%{_datadir}" \
+ sysconfdir="%{_sysconfdir}" \
+ lib="%{_lib}"
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc CHANGES FAQ README* RELEASE*
+%doc AUTHORS CHANGES FAQ README*
%doc Documentation/*.{html,png}
%attr(755,root,root) %{_sbindir}/iptraf-ng
-%attr(755,root,root) %{_sbindir}/rvnamed-ng
%attr(750,root,root) %dir /var/lib/iptraf-ng
%attr(750,root,root) %dir /var/log/iptraf-ng
-%{_mandir}/man*/*
+%{_mandir}/man8/iptraf-ng.8*