From 2e65facd12caffba364444104198c76184d26879 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Sun, 17 Apr 2016 15:38:22 -0500 Subject: [PATCH] Clean up, added sources --- .gitignore | 4 + ...ing-point-exception-in-tcplog_flowra.patch | 37 --------- ...-Makefile-add-Werror-format-security.patch | 79 ------------------- iptraf-ng-logrotate.conf | 9 --- iptraf-ng-tmpfiles.conf | 1 - sources | 2 +- 6 files changed, 5 insertions(+), 127 deletions(-) delete mode 100644 0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch delete mode 100644 0002-Makefile-add-Werror-format-security.patch delete mode 100644 iptraf-ng-logrotate.conf delete mode 100644 iptraf-ng-tmpfiles.conf diff --git a/.gitignore b/.gitignore index 17df152..786ff75 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ /iptraf-ng-1.1.3.1.tar.gz /iptraf-ng-1.1.4.tar.gz /0001-fix-segfault-in-adding-interface.patch +/iptraf-ng-tmpfiles.conf +/iptraf-ng-logrotate.conf +/0001-BUGFIX-fix-Floating-point-exception-in-tcplog_flowra.patch +/0002-Makefile-add-Werror-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/0002-Makefile-add-Werror-format-security.patch b/0002-Makefile-add-Werror-format-security.patch deleted file mode 100644 index 54192ee..0000000 --- a/0002-Makefile-add-Werror-format-security.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 202b2e7b27a159d54a525b0cfd366b8d52d5a3a1 Mon Sep 17 00:00:00 2001 -Message-Id: <202b2e7b27a159d54a525b0cfd366b8d52d5a3a1.1386069831.git.npajkovs@redhat.com> -From: Nikola Pajkovsky -Date: Tue, 3 Dec 2013 12:12:16 +0100 -Subject: [PATCH] Makefile: add -Werror=format-security -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - --Wformat-security - If -Wformat is specified, also warn about uses of format - functions that represent possible security problems. At - present, this warns about calls to printf and scanf functions - where the format string is not a string literal and there are - no format arguments, as in printf (foo);. This may be a - security hole if the format string came from untrusted input - and contains ā€˜%nā€™. (This is currently a subset of what - -Wformat-nonliteral warns about, but in future warnings may be - added to -Wformat-security that are not included in - -Wformat-nonliteral.) - -Signed-off-by: Nikola Pajkovsky ---- - Makefile | 2 +- - src/ipfilter.c | 2 +- - src/othptab.c | 4 ++-- - 3 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/Makefile b/Makefile -index 46e5632e3287..958b0fbeec0f 100644 ---- a/Makefile -+++ b/Makefile -@@ -18,7 +18,7 @@ VERSION-FILE: FORCE - @$(SHELL_PATH) ./GEN-VERSION-FILE - -include VERSION-FILE - --CFLAGS = -g -O2 -Wall -W -std=gnu99 -+CFLAGS = -g -O2 -Wall -W -std=gnu99 -Werror=format-security - LDFLAGS = - ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) - ALL_LDFLAGS = $(LDFLAGS) -diff --git a/src/ipfilter.c b/src/ipfilter.c -index eb17ec7c7615..8c76e4c801c2 100644 ---- a/src/ipfilter.c -+++ b/src/ipfilter.c -@@ -146,7 +146,7 @@ void gethostparams(struct hostparams *data, char *init_saddr, char *init_smask, - 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; -diff --git a/src/othptab.c b/src/othptab.c -index 5c09241fca99..e23f39e5df45 100644 ---- a/src/othptab.c -+++ b/src/othptab.c -@@ -407,7 +407,7 @@ void printothpentry(struct othptable *table, struct othptabent *entry, - break; - } - -- sprintf(scratchpad, rarp_mac_addr); -+ sprintf(scratchpad, "%s", rarp_mac_addr); - strcat(msgstring, scratchpad); - wattrset(table->othpwin, ARPATTR); - break; -@@ -482,7 +482,7 @@ void printothpentry(struct othptable *table, struct othptabent *entry, - 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; --- -1.8.3.2 - diff --git a/iptraf-ng-logrotate.conf b/iptraf-ng-logrotate.conf deleted file mode 100644 index 1b05165..0000000 --- a/iptraf-ng-logrotate.conf +++ /dev/null @@ -1,9 +0,0 @@ -# Logrotate file for iptraf -/var/log/iptraf-ng/*.log { - compress - delaycompress - missingok - notifempty - rotate 4 - create 0600 root root -} diff --git a/iptraf-ng-tmpfiles.conf b/iptraf-ng-tmpfiles.conf deleted file mode 100644 index 2c915d8..0000000 --- a/iptraf-ng-tmpfiles.conf +++ /dev/null @@ -1 +0,0 @@ -d /run/iptraf-ng 0755 root root - diff --git a/sources b/sources index b339235..71bab05 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3cdebfcb6c55cb6ddf1829e2df79f7e7 0001-fix-segfault-in-adding-interface.patch +25929a75470f7ab671b974b13bff6c02 0002-Makefile-add-Werror-format-security.patch