From owner-dev-commits-ports-main@freebsd.org Mon Jun 14 17:46:32 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C68E266196F; Mon, 14 Jun 2021 17:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G3f5N0LDyz3vGX; Mon, 14 Jun 2021 17:46:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBEE31904C; Mon, 14 Jun 2021 17:46:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15EHkVLb053318; Mon, 14 Jun 2021 17:46:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15EHkVa4053317; Mon, 14 Jun 2021 17:46:31 GMT (envelope-from git) Date: Mon, 14 Jun 2021 17:46:31 GMT Message-Id: <202106141746.15EHkVa4053317@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: dfac76115bc0 - main - security/snoopy: Convert REINPLACE_CMD to patch files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfac76115bc0edeb751f0c73ad8423c7ebd80c01 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2021 17:46:33 -0000 The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=dfac76115bc0edeb751f0c73ad8423c7ebd80c01 commit dfac76115bc0edeb751f0c73ad8423c7ebd80c01 Author: Po-Chuan Hsieh AuthorDate: 2021-06-14 17:38:34 +0000 Commit: Po-Chuan Hsieh CommitDate: 2021-06-14 17:38:34 +0000 security/snoopy: Convert REINPLACE_CMD to patch files --- security/snoopy/Makefile | 12 -------- .../snoopy/files/patch-build-Makefile.am.common | 8 +++++ security/snoopy/files/patch-build-snoopy.m4 | 4 +-- security/snoopy/files/patch-configure.ac | 36 ++++++++++++++++++++-- security/snoopy/files/patch-src-configfile.c | 12 ++++++++ .../snoopy/files/patch-src-datasource-domain.c | 26 ++++++++++++++++ security/snoopy/files/patch-src-datasource-sid.c | 10 ++++++ .../snoopy/files/patch-src-output-socketoutput.c | 10 ++++++ security/snoopy/files/patch-src-snoopy.h | 11 +++++++ .../patch-tests-bin-snoopy-test-exec-in-threads.c | 11 +++++++ 10 files changed, 124 insertions(+), 16 deletions(-) diff --git a/security/snoopy/Makefile b/security/snoopy/Makefile index 49a6da308320..ac0681295633 100644 --- a/security/snoopy/Makefile +++ b/security/snoopy/Makefile @@ -27,19 +27,7 @@ SHEBANG_GLOB= *.sh OPTIONS_DEFINE= DOCS post-patch: - @${REINPLACE_CMD} -e 's| -Wall -Werror||' ${WRKSRC}/configure.ac ${WRKSRC}/build/Makefile.am.common - @${REINPLACE_CMD} -e '/gcov/d' ${WRKSRC}/configure.ac @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${WRKSRC}/README.md - @${REINPLACE_CMD} -e '/#define.*_XOPEN_SOURCE/d' \ - ${WRKSRC}/src/configfile.c \ - ${WRKSRC}/src/datasource/sid.c \ - ${WRKSRC}/src/datasource/snoopy_version.c \ - ${WRKSRC}/src/snoopy.h \ - ${WRKSRC}/tests/bin/snoopy-test-threads.c \ - ${WRKSRC}/src/tsrm.c - @${REINPLACE_CMD} -e '/features.h/d' ${WRKSRC}/configure.ac ${WRKSRC}/src/output/socketoutput.c ${WRKSRC}/src/snoopy.h - @${REINPLACE_CMD} -e 's|HOST_NAME_MAX|_POSIX_&|' ${WRKSRC}/src/datasource/domain.c - @${REINPLACE_CMD} -e 's|#include |#include |' ${WRKSRC}/tests/bin/snoopy-test-exec-in-threads.c ${WRKSRC}/tests/bin/snoopy-test-threads.c do-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR}/ diff --git a/security/snoopy/files/patch-build-Makefile.am.common b/security/snoopy/files/patch-build-Makefile.am.common new file mode 100644 index 000000000000..8f6b8156fa43 --- /dev/null +++ b/security/snoopy/files/patch-build-Makefile.am.common @@ -0,0 +1,8 @@ +--- build/Makefile.am.common.orig 2020-12-28 04:42:28 UTC ++++ build/Makefile.am.common +@@ -10,4 +10,4 @@ MAINTAINERCLEANFILES = Makefile.in + # -I$(top_srcdir)/src is here for #include "snoopy.h" (or similar) to work everywhere + # -I$(top_srcdir) is here for #include "lib/*/src/*.h" to work everywhere (additionally, this also makes references "src/*/*.h" work too) + # +-AM_CFLAGS = -Wall -Werror -Wextra -Wno-unused-parameter -std=c99 -Wpedantic -I$(top_srcdir)/src -I$(top_srcdir) ++AM_CFLAGS = -Wextra -Wno-unused-parameter -std=c99 -Wpedantic -I$(top_srcdir)/src -I$(top_srcdir) diff --git a/security/snoopy/files/patch-build-snoopy.m4 b/security/snoopy/files/patch-build-snoopy.m4 index 286fc99deebd..624bbabea826 100644 --- a/security/snoopy/files/patch-build-snoopy.m4 +++ b/security/snoopy/files/patch-build-snoopy.m4 @@ -1,6 +1,6 @@ ---- build/snoopy.m4.orig 2016-09-14 15:02:26 UTC +--- build/snoopy.m4.orig 2020-12-07 03:14:46 UTC +++ build/snoopy.m4 -@@ -183,7 +183,8 @@ AU_DEFUN([SNOOPY_CONFIGURE_ENTITY_MSG], +@@ -191,7 +191,8 @@ AU_DEFUN([SNOOPY_CONFIGURE_ENTITY_MSG], [ dotLine=".................................................."; whatString="Snoopy $1 enabled: $3 "; diff --git a/security/snoopy/files/patch-configure.ac b/security/snoopy/files/patch-configure.ac index 50427be8472d..082eba06c24c 100644 --- a/security/snoopy/files/patch-configure.ac +++ b/security/snoopy/files/patch-configure.ac @@ -1,6 +1,23 @@ ---- configure.ac.orig 2016-09-14 15:02:26 UTC +--- configure.ac.orig 2021-01-18 13:01:11 UTC +++ configure.ac -@@ -125,12 +125,6 @@ SNOOPY_PROG_CHECK([wc], [WC], +@@ -30,7 +30,7 @@ AC_CONFIG_SRCDIR([src/eventsource/execve_wrapper.c]) + AC_CONFIG_AUX_DIR([build/aux]) + AC_CONFIG_MACRO_DIR([build/m4]) + m4_include([build/snoopy.m4]) +-AM_INIT_AUTOMAKE([1.11 gnu silent-rules subdir-objects -Wall -Werror]) ++AM_INIT_AUTOMAKE([1.11 gnu silent-rules subdir-objects]) + + + ### Silent make output +@@ -81,7 +81,6 @@ AC_PROG_SED + ### Check for programs required for TEST suite + # + SNOOPY_PROG_REQUIRE([dirname], [DIRNAME], [Needed for "make check" test suite.]) +-SNOOPY_PROG_REQUIRE([gcov], [GCOV], [Needed for "make coverage" build target.]) + SNOOPY_PROG_REQUIRE([readlink], [READLINK], [Needed for "make check" test suite.]) + SNOOPY_PROG_SUGGEST([socat], [SOCAT], [Needed for "make check" test suite.]) + SNOOPY_PROG_SUGGEST([ps], [PS], [Needed for "make check" test suite.]) +@@ -89,19 +88,12 @@ SNOOPY_PROG_REQUIRE([wc], [WC], [Needed fo @@ -13,3 +30,18 @@ dnl Checks for header files. AC_CHECK_HEADERS([ \ ctype.h \ + dlfcn.h \ + errno.h \ + fcntl.h \ +- features.h \ + grp.h \ + limits.h \ + pwd.h \ +@@ -784,7 +776,6 @@ AS_IF([test "x$code_coverage_enabled" = "xyes"], [ + CXXFLAGS=`echo $CXXFLAGS | sed 's/-O[1-9s]/-O0/g'` + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + CXXFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" +- LDFLAGS="$LDFLAGS -lgcov --coverage" + changequote([,]) + ]) + diff --git a/security/snoopy/files/patch-src-configfile.c b/security/snoopy/files/patch-src-configfile.c new file mode 100644 index 000000000000..b1f7ce702b65 --- /dev/null +++ b/security/snoopy/files/patch-src-configfile.c @@ -0,0 +1,12 @@ +--- src/configfile.c.orig 2020-12-07 03:14:46 UTC ++++ src/configfile.c +@@ -35,9 +35,6 @@ + + #include "lib/inih/src/ini.h" + +-#ifndef _XOPEN_SOURCE // For strdup +-#define _XOPEN_SOURCE 500 +-#endif + #include + #include + #include diff --git a/security/snoopy/files/patch-src-datasource-domain.c b/security/snoopy/files/patch-src-datasource-domain.c new file mode 100644 index 000000000000..aa0a3226e961 --- /dev/null +++ b/security/snoopy/files/patch-src-datasource-domain.c @@ -0,0 +1,26 @@ +--- src/datasource/domain.c.orig 2020-12-17 13:03:54 UTC ++++ src/datasource/domain.c +@@ -44,7 +44,7 @@ + /* + * Local defines + */ +-#define HOST_NAME_BUF_SIZE HOST_NAME_MAX + 2 // +1 for terminal \0 and +1 because we'll be adding a trailing dot ++#define HOST_NAME_BUF_SIZE _POSIX_HOST_NAME_MAX + 2 // +1 for terminal \0 and +1 because we'll be adding a trailing dot + #define HOSTS_PATH "/etc/hosts" + #define HOSTS_LINE_SIZE_MAX 1024 + #define HOSTS_LINE_POS_MAX 1023 +@@ -76,12 +76,12 @@ int snoopy_datasource_domain (char * const result, cha + * START: COPY FROM datasource/hostname + */ + /* Get my hostname first */ +- retVal = gethostname(hostname, HOST_NAME_MAX); ++ retVal = gethostname(hostname, _POSIX_HOST_NAME_MAX); + if (0 != retVal) { + return snprintf(result, SNOOPY_DATASOURCE_MESSAGE_MAX_SIZE, "(error @ gethostname(): %d)", errno); + } + +- // If hostname was something alien (longer than HOST_NAME_MAX), then the ++ // If hostname was something alien (longer than _POSIX_HOST_NAME_MAX), then the + // last character may not be NULL (the behavior is unspecified). + // Let's avoid any surprises and null-terminate at the end of this buffer. + hostname[HOST_NAME_BUF_SIZE-1] = '\0'; diff --git a/security/snoopy/files/patch-src-datasource-sid.c b/security/snoopy/files/patch-src-datasource-sid.c new file mode 100644 index 000000000000..e931d170a183 --- /dev/null +++ b/security/snoopy/files/patch-src-datasource-sid.c @@ -0,0 +1,10 @@ +--- src/datasource/sid.c.orig 2020-12-06 01:59:36 UTC ++++ src/datasource/sid.c +@@ -30,7 +30,6 @@ + #include "snoopy.h" + + #ifndef _XOPEN_SOURCE /* Needed to get getpgid and getsid on older glibc */ +-#define _XOPEN_SOURCE 500 + #endif + #include + #include diff --git a/security/snoopy/files/patch-src-output-socketoutput.c b/security/snoopy/files/patch-src-output-socketoutput.c new file mode 100644 index 000000000000..daba0cda43d3 --- /dev/null +++ b/security/snoopy/files/patch-src-output-socketoutput.c @@ -0,0 +1,10 @@ +--- src/output/socketoutput.c.orig 2020-12-07 03:14:46 UTC ++++ src/output/socketoutput.c +@@ -30,7 +30,6 @@ + #include "snoopy.h" + #include "configuration.h" + +-#include + #include + #include + #include diff --git a/security/snoopy/files/patch-src-snoopy.h b/security/snoopy/files/patch-src-snoopy.h new file mode 100644 index 000000000000..e358ebb2a715 --- /dev/null +++ b/security/snoopy/files/patch-src-snoopy.h @@ -0,0 +1,11 @@ +--- src/snoopy.h.orig 2021-02-09 23:00:14 UTC ++++ src/snoopy.h +@@ -31,8 +31,6 @@ + /* This must be the first file to be included, or implicit inclusion + * (by i.e. ) does the wrong thing + */ +-#define _XOPEN_SOURCE 700 +-#include /* Needed for GLIBC macros here */ + #include /* Needed for syslog defaults */ + #include + diff --git a/security/snoopy/files/patch-tests-bin-snoopy-test-exec-in-threads.c b/security/snoopy/files/patch-tests-bin-snoopy-test-exec-in-threads.c new file mode 100644 index 000000000000..2474375760e4 --- /dev/null +++ b/security/snoopy/files/patch-tests-bin-snoopy-test-exec-in-threads.c @@ -0,0 +1,11 @@ +--- tests/bin/snoopy-test-exec-in-threads.c.orig 2020-12-07 03:14:46 UTC ++++ tests/bin/snoopy-test-exec-in-threads.c +@@ -31,7 +31,7 @@ + #include + #include + #include +-#include ++#include + + +