iptraf-ng: Add new recipe
PATCH 1/2 iptraf-ng: Add new recipe
Delete iptraf and use iptraf-ng to provide
iptraf functionality
Signed-off-by Khem Raj <[email protected]>
--- .../0001-Fix-printd-formatting-strings.patch | 54 ++++++++ .../iptraf/iptraf-ng/ncurses-config.patch | 81 ++++++++++++ meta-oe/recipes-devtools/iptraf/iptraf-ng_1.1.4.bb | 42 +++++++ .../0001-src-Fix-error-in-cross-compile.patch | 138 --------------------- .../iptraf/iptraf/format_string.patch | 31 ----- .../recipes-devtools/iptraf/iptraf/ldopts.patch | 35 ------ meta-oe/recipes-devtools/iptraf/iptraf_3.0.0.bb | 42 ------- 7 files changed, 177 insertions(+), 246 deletions(-) create mode 100644 meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-Fix-printd-formatting-strings.patch create mode 100644 meta-oe/recipes-devtools/iptraf/iptraf-ng/ncurses-config.patch create mode 100644 meta-oe/recipes-devtools/iptraf/iptraf-ng_1.1.4.bb delete mode 100644 meta-oe/recipes-devtools/iptraf/iptraf/0001-src-Fix-error-in-cross-compile.patch delete mode 100644 meta-oe/recipes-devtools/iptraf/iptraf/format_string.patch delete mode 100644 meta-oe/recipes-devtools/iptraf/iptraf/ldopts.patch delete mode 100644 meta-oe/recipes-devtools/iptraf/iptraf_3.0.0.bb
meta-oe/recipes-devtools/iptraf/iptraf-ng/0001-Fix-printd-formatting-strings.patch new file +54 -0
@@ -0,0 +1,54 @@ +From 86b4d398dbb95e2437b70eba3b30e995ec9be505 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Thu, 31 Aug 2017 20:47:50 -0700 +Subject: [PATCH] Fix printd formatting strings + +Fixes +error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + src/ipfilter.c | 2 +- + src/othptab.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/ipfilter.c b/src/ipfilter.c +index eb17ec7..8c76e4c 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 142c9c2..fe395c2 100644 +--- a/src/othptab.c ++++ b/src/othptab.c +@@ -410,7 +410,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; +@@ -485,7 +485,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; +-- +2.14.1 +
meta-oe/recipes-devtools/iptraf/iptraf-ng/ncurses-config.patch new file +81 -0
81 lines not on this page · raw message
meta-oe/recipes-devtools/iptraf/iptraf-ng_1.1.4.bb new file +42 -0
42 lines not on this page · raw message
meta-oe/recipes-devtools/iptraf/iptraf/0001-src-Fix-error-in-cross-compile.patch deleted +0 -138
138 lines not on this page · raw message
meta-oe/recipes-devtools/iptraf/iptraf/format_string.patch deleted +0 -31
@@ -1,31 +0,0 @@ -Index: iptraf-3.0.0/src/othptab.c -=================================================================== ---- iptraf-3.0.0.orig/src/othptab.c -+++ iptraf-3.0.0/src/othptab.c -@@ -335,7 +335,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; -@@ -354,7 +354,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; -@@ -421,7 +421,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;
meta-oe/recipes-devtools/iptraf/iptraf/ldopts.patch deleted +0 -35
@@ -1,35 +0,0 @@ -Index: iptraf-3.0.0/src/Makefile -=================================================================== ---- iptraf-3.0.0.orig/src/Makefile -+++ iptraf-3.0.0/src/Makefile -@@ -5,7 +5,7 @@ - # - # Architecture determination string borrowed from the kernel makefile. - # --ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ -+ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ - -e s/arm.*/arm/ -e s/sa110/arm/) - PLATFORM = -DPLATFORM=\"$(shell uname -s)/$(ARCH)\" - VERNUMBER := $(shell cat version) -@@ -17,7 +17,7 @@ VERSION = -DVERSION=\"$(VERNUMBER)\" - # - BINDIR = ../../iptraf-$(VERNUMBER).bin.$(ARCH) - --CC = gcc -+CC = $(CC) - LIBS = -L../support -ltextbox -lpanel -lncurses # in this order! - - # comment this one out to omit debug code when done. -@@ -31,10 +31,10 @@ PROF = #-pg - # options to be passed to the compiler. I don't believe they need to be - # modified (except for -m486 on non-Intel x86 platforms). - --CFLAGS = -Wall #-O2 #-m486 -+CFLAGS ?= -Wall #-O2 #-m486 - DIRS = -DWORKDIR=\"$(WORKDIR)\" \ - -DLOGDIR=\"$(LOGDIR)\" -DEXECDIR=\"$(TARGET)\" --LDOPTS = #-static -+LDOPTS ?= #-static - - # you may want to change this to point to your ncurses include directory - # if the ncurses include files are not in the default location.
meta-oe/recipes-devtools/iptraf/iptraf_3.0.0.bb deleted +0 -42
42 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH 2/2 sblim-sfcb: Fix build with musl
Signed-off-by Khem Raj <[email protected]>
--- ...e-need-for-error.h-when-it-does-not-exist.patch | 124 +++++++++++++++++++++ .../sblim-sfcb/sblim-sfcb_1.4.9.bb | 1 + 2 files changed, 125 insertions(+) create mode 100644 meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-Replace-need-for-error.h-when-it-does-not-exist.patch
meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb-1.4.9/0001-Replace-need-for-error.h-when-it-does-not-exist.patch new file +124 -0
@@ -0,0 +1,124 @@ +From 394bf0f1ed07419d40f6024363cc1ffc7ef61bc6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Thu, 31 Aug 2017 21:56:25 -0700 +Subject: [PATCH] Replace need for error.h when it does not exist + +helps fixing build on musl + +Signed-off-by: Khem Raj <[email protected]> +--- +Upstream-Status: Pending + + brokerUpc.c | 5 ++++- + configure.ac | 2 +- + httpAdapter.c | 4 +++- + support.c | 14 +++++++++++++- + trace.c | 4 +++- + 5 files changed, 24 insertions(+), 5 deletions(-) + +diff --git a/brokerUpc.c b/brokerUpc.c +index 17cbd9b..fe2b347 100644 +--- a/brokerUpc.c ++++ b/brokerUpc.c +@@ -20,8 +20,11 @@ + + #include <stdio.h> + #include <stdlib.h> ++#ifdef HAVE_ERROR_H + #include <error.h> +- ++#else ++#include <err.h> ++#endif + #include "support.h" + #include "native.h" + #include <sfcCommon/utilft.h> +diff --git a/configure.ac b/configure.ac +index ab2964e..d4915a1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -517,7 +517,7 @@ fi + # Checks for header files. + AC_HEADER_STDC + AC_HEADER_SYS_WAIT +-AC_CHECK_HEADERS([fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h zlib.h]) ++AC_CHECK_HEADERS([error.h fcntl.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h zlib.h]) + AC_CHECK_HEADERS([cmpi/cmpimacs.h cmpi/cmpift.h cmpi/cmpidt.h],[],[AC_MSG_ERROR([Could not find required CPMI header.])]) + + # Checks for typedefs, structures, and compiler characteristics. +diff --git a/httpAdapter.c b/httpAdapter.c +index 2719e6c..e768972 100644 +--- a/httpAdapter.c ++++ b/httpAdapter.c +@@ -71,7 +71,9 @@ + #ifdef HAVE_UDS + #include <grp.h> + #endif +- ++#ifndef __SOCKADDR_ARG ++# define __SOCKADDR_ARG struct sockaddr *__restrict ++#endif + /* should probably go into cimRequest.h */ + #define CIM_PROTOCOL_ANY 0 + #define CIM_PROTOCOL_CIM_XML 1 +diff --git a/support.c b/support.c +index c7bba8b..5b3eef1 100644 +--- a/support.c ++++ b/support.c +@@ -32,7 +32,11 @@ + #include "support.h" + #include <stdio.h> + #include <stdlib.h> ++#ifdef HAVE_ERROR_H + #include <error.h> ++#else ++#include <err.h> ++#endif + #include <errno.h> + #include "native.h" + #include "trace.h" +@@ -331,17 +335,25 @@ loadQualifierDeclMI(const char *provider, + _SFCB_RETURN(NULL); + }; + ++ + /****************************************************************************/ + + /** Exits the program with a memory allocation error message in case the given + * condition holds. + */ ++#if HAVE_ERROR_H + #define __ALLOC_ERROR(cond) \ + if ( cond ) { \ + error_at_line ( -1, errno, __FILE__, __LINE__, \ + "unable to allocate requested memory." ); \ + } +- ++#else ++#define __ALLOC_ERROR(cond) \ ++ if ( cond ) { \ ++ err(1, "%s:%d: %s", __FILE__, __LINE__, \ ++ "unable to allocate requested memory." ); \ ++ } ++#endif + /** + * flag to ensure MM is initialized only once + */ +diff --git a/trace.c b/trace.c +index d7f30db..438af46 100644 +--- a/trace.c ++++ b/trace.c +@@ -279,7 +279,9 @@ _sfcb_trap(int tn) + } + #endif + } +- ++#ifndef SA_INTERRUPT ++# define SA_INTERRUPT 0x20000000 /* from GLIBC's <bits/sigaction.h> */ ++#endif + sigHandler * + setSignal(int sn, sigHandler * sh, int flags) + { +-- +2.14.1 +
meta-oe/recipes-extended/sblim-sfcb/sblim-sfcb_1.4.9.bb +1 -0
@@ -21,6 +21,7 @@ SRC_URI = "http://downloads.sourceforge.net/sblim/${BP}.tar.bz2 \ file://sblim-sfcb-1.4.8-default-ecdh-curve-name.patch \ file://sblim-sfcb-1.4.9-fix-ftbfs.patch \ file://0001-include-stdint.h-system-header-for-UINT16_MAX.patch \ + file://0001-Replace-need-for-error.h-when-it-does-not-exist.patch \ " SRC_URI[md5sum] = "28021cdabc73690a94f4f9d57254ce30"
Signature · 1 line
2.14.1