From 46ca87b200a8c612f799c83fe45659591bfe8ee6 Mon Sep 17 00:00:00 2001 From: Marcin Banasiak Date: Tue, 5 Feb 2013 17:41:54 +0100 Subject: [PATCH] Fix build - -include.patch fixes build with recent kernels where linux/if_tr.h is not available - -format-security.patch fixes build with -Werror=format-security --- iptraf-ng-format-security.patch | 40 +++++++++++++++++++++++++++++++++ iptraf-ng-include.patch | 11 +++++++++ iptraf-ng.spec | 4 ++++ 3 files changed, 55 insertions(+) create mode 100644 iptraf-ng-format-security.patch create mode 100644 iptraf-ng-include.patch diff --git a/iptraf-ng-format-security.patch b/iptraf-ng-format-security.patch new file mode 100644 index 0000000..c8c5160 --- /dev/null +++ b/iptraf-ng-format-security.patch @@ -0,0 +1,40 @@ +--- 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 +@@ -410,7 +410,7 @@ void printothpentry(struct othptable *ta + break; + } + +- sprintf(scratchpad, inet_ntoa(saddr)); ++ sprintf(scratchpad, "%s", inet_ntoa(saddr)); + strcat(msgstring, scratchpad); + wattrset(table->othpwin, ARPATTR); + break; +@@ -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-include.patch b/iptraf-ng-include.patch new file mode 100644 index 0000000..803577f --- /dev/null +++ b/iptraf-ng-include.patch @@ -0,0 +1,11 @@ +--- iptraf-ng-1.1.3.1/src/iptraf-ng-compat.h.tokenring 2013-02-05 13:54:53.008646938 +0100 ++++ iptraf-ng-1.1.3.1/src/iptraf-ng-compat.h 2013-02-05 13:55:25.261805541 +0100 +@@ -39,7 +39,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + diff --git a/iptraf-ng.spec b/iptraf-ng.spec index aae3705..d0e55e4 100644 --- a/iptraf-ng.spec +++ b/iptraf-ng.spec @@ -12,6 +12,8 @@ Group: Networking/Utilities Source0: https://fedorahosted.org/releases/i/p/iptraf-ng/%{name}-%{version}.tar.gz # Source0-md5: 1a2c02944b0b012d6a3de96207610fa2 URL: https://fedorahosted.org/iptraf-ng/ +Patch0: %{name}-include.patch +Patch1: %{name}-format-security.patch BuildRequires: ncurses-ext-devel >= 5.4 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -61,6 +63,8 @@ SLIP/PPP. %define _bindir %{_sbindir} %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build %configure \ -- 2.44.0