From ae401b931fb81adaa1f3ef56f87087745ec6ec47 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Mon, 5 Sep 2022 14:08:58 +0200 Subject: [PATCH] up to 1.2.1 - project moved to github --- ...ing-point-exception-in-tcplog_flowra.patch | 37 ---------------- iptraf-ng-format-security.patch | 31 ------------- iptraf-ng.spec | 43 +++++++++++-------- 3 files changed, 26 insertions(+), 85 deletions(-) delete mode 100644 0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch delete mode 100644 iptraf-ng-format-security.patch diff --git a/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch b/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch deleted file mode 100644 index 7a156b6..0000000 --- a/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9b320138755542b927df650da0bd1e61ecaa41d7 Mon Sep 17 00:00:00 2001 -Message-Id: <9b320138755542b927df650da0bd1e61ecaa41d7.1378117677.git.npajkovs@redhat.com> -From: Vitezslav Samel -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. -Signed-off-by: Vitezslav Samel -Signed-off-by: Nikola Pajkovsky ---- - 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 - diff --git a/iptraf-ng-format-security.patch b/iptraf-ng-format-security.patch deleted file mode 100644 index 7b6bb93..0000000 --- a/iptraf-ng-format-security.patch +++ /dev/null @@ -1,31 +0,0 @@ ---- 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; diff --git a/iptraf-ng.spec b/iptraf-ng.spec index a7f6745..0070eb1 100644 --- a/iptraf-ng.spec +++ b/iptraf-ng.spec @@ -5,15 +5,16 @@ Summary(pt_BR.UTF-8): Ferramenta baseada no console para monitoração de rede 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) @@ -61,16 +62,18 @@ IPTraf - консольна утиліта моніторингу IP-трафі конкретних комп'ютерах. 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 @@ -78,17 +81,23 @@ install -d $RPM_BUILD_ROOT/var/{lib,log}/iptraf-ng %{__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* -- 2.44.0