1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-20 08:27:15 +00:00

Update to 2.4.6

- Update COMMENT
- Add LICENSE_FILE
- Strip shared library

Changes:	https://github.com/a2o/snoopy/blob/master/ChangeLog
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2018-01-30 15:38:23 +00:00
parent 641bb78db5
commit 5967dce34a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=460393
14 changed files with 189 additions and 15 deletions

View File

@ -2,34 +2,39 @@
# $FreeBSD$
PORTNAME= snoopy
PORTVERSION= 1.9.0
PORTVERSION= 2.4.6
DISTVERSIONPREFIX= ${PORTNAME}-
CATEGORIES= security
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= execve() wrapper and logger
COMMENT= Log every executed command to syslog
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
BUILD_DEPENDS= bash:shells/bash
TEST_DEPENDS= socat:net/socat
OPTIONS_DEFINE= DOCS
CONFIGURE_ARGS= --disable-datasource-tid_kernel \
ac_cv_prog_SNOOPY_PROG_SOCAT_FOUND=yes
GNU_CONFIGURE= yes
USES= gmake
PLIST_FILES= bin/detect lib/snoopy.so
PORTDOCS= ChangeLog README.md TODO
INSTALL_TARGET= install-strip
USE_LDCONFIG= yes
USES= autoreconf gmake libtool shebangfix
GH_ACCOUNT= a2o
USE_GITHUB= yes
post-patch:
@${REINPLACE_CMD} '/^LIBS=/d' ${WRKSRC}/Makefile.in
@${REINPLACE_CMD} 's|/usr/local|${PREFIX}|g' ${WRKSRC}/README.md
SHEBANG_GLOB= *.sh
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/detect ${STAGEDIR}${PREFIX}/bin/
${INSTALL_LIB} ${WRKSRC}/snoopy.so ${STAGEDIR}${PREFIX}/lib/
post-patch:
@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${WRKSRC}/README.md
do-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}/
cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/
cd ${WRKSRC}/ && ${INSTALL_DATA} ChangeLog README.md ${STAGEDIR}${DOCSDIR}/
cd ${WRKSRC}/doc/ && ${INSTALL_DATA} CONTRIBUTING.md FAQ.md FILTER_exclude_spawns_of.md HACKING.md INSTALL.md ${STAGEDIR}${DOCSDIR}/
.include <bsd.port.mk>

View File

@ -1,2 +1,3 @@
SHA256 (a2o-snoopy-snoopy-1.9.0_GH0.tar.gz) = f259dbd26a521eb0a6e1722ffc41d385436dfcbef1e6d45cfb1bc2863e9f4e2d
SIZE (a2o-snoopy-snoopy-1.9.0_GH0.tar.gz) = 56543
TIMESTAMP = 1475137530
SHA256 (a2o-snoopy-snoopy-2.4.6_GH0.tar.gz) = c92919fbd959c19e2e7ae110705759bdf8b19a3ba215bd4dabfb820003bb057d
SIZE (a2o-snoopy-snoopy-2.4.6_GH0.tar.gz) = 128845

View File

@ -0,0 +1,8 @@
--- build/Makefile.am.common.orig 2016-09-14 15:02:26 UTC
+++ build/Makefile.am.common
@@ -9,4 +9,4 @@ MAINTAINERCLEANFILES = Makefile.in
# Note:
# -I$(top_srcdir) is here for #include 'lib/iniparser/src/iniparser.h' to work
#
-AM_CFLAGS = -Wall -Werror -Wextra -Wno-unused-parameter -std=c99 -pedantic -I$(top_srcdir)
+AM_CFLAGS = -Wextra -Wno-unused-parameter -std=c99 -pedantic -I$(top_srcdir)

View File

@ -0,0 +1,12 @@
--- build/snoopy.m4.orig 2016-09-14 15:02:26 UTC
+++ build/snoopy.m4
@@ -183,7 +183,8 @@ AU_DEFUN([SNOOPY_CONFIGURE_ENTITY_MSG],
[
dotLine="..................................................";
whatString="Snoopy $1 enabled: $3 ";
- whatStringPadded="$whatString${dotLine:${#whatString}}";
+ dotLine2=$(echo ${dotLine} | cut -d. -f${#whatString}-)
+ whatStringPadded="$whatString${dotLine2}";
if test "x$4" == "xyes"; then
AC_MSG_NOTICE([$whatStringPadded YES])
elif test "x$4" == "xno"; then

View File

@ -0,0 +1,30 @@
--- configure.ac.orig 2016-09-14 15:02:26 UTC
+++ configure.ac
@@ -30,7 +30,7 @@ AC_CONFIG_SRCDIR([src/eventsource/execve
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
@@ -125,18 +125,11 @@ SNOOPY_PROG_CHECK([wc], [WC],
-dnl Checks for libraries.
-dnl FIXME: Replace `main' with a function in `-ldl':
-AC_CHECK_LIB([dl], [dlsym], [], [
- AC_MSG_ERROR([A library is missing. Unable to continue.])
-])
-
dnl Checks for header files.
AC_CHECK_HEADERS([ \
ctype.h \
dlfcn.h \
errno.h \
- features.h \
grp.h \
limits.h \
pwd.h \

View File

@ -0,0 +1,12 @@
--- src/configfile.c.orig 2016-09-14 15:02:26 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 <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -0,0 +1,10 @@
--- src/datasource/sid.c.orig 2016-09-14 15:02:26 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 <stdio.h>
#include <sys/types.h>

View File

@ -0,0 +1,10 @@
--- src/datasource/snoopy_version.c.orig 2016-09-14 15:02:26 UTC
+++ src/datasource/snoopy_version.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 <stdio.h>
#include <sys/types.h>

View File

@ -0,0 +1,10 @@
--- src/output/socketoutput.c.orig 2016-09-14 15:02:26 UTC
+++ src/output/socketoutput.c
@@ -30,7 +30,6 @@
#include "snoopy.h"
#include "configuration.h"
-#include <features.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -0,0 +1,14 @@
--- src/snoopy.h.orig 2016-09-14 15:02:26 UTC
+++ src/snoopy.h
@@ -31,11 +31,6 @@
/* This must be the first file to be included, or implicit inclusion
* (by i.e. <features.h>) does the wrong thing
*/
-#ifdef _XOPEN_SOURCE
-#undef _XOPEN_SOURCE
-#endif
-#define _XOPEN_SOURCE 500
-#include <features.h> /* Needed for GLIBC macros here */
#include <syslog.h> /* Needed for syslog defaults */
#include <unistd.h> /* Needed for _SC_ARG_MAX constant */

View File

@ -0,0 +1,10 @@
--- src/tsrm.c.orig 2016-09-14 15:02:26 UTC
+++ src/tsrm.c
@@ -25,7 +25,6 @@
/*
* Includes order: from local to global
*/
-#define _XOPEN_SOURCE 700 // Required by pthread_mutex_setattr
#include "tsrm.h"

View File

@ -0,0 +1,11 @@
--- tests/bin/snoopy-test-exec-in-threads.c.orig 2016-09-14 15:02:26 UTC
+++ tests/bin/snoopy-test-exec-in-threads.c
@@ -31,7 +31,7 @@
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
-#include <wait.h>
+#include <sys/wait.h>

View File

@ -0,0 +1,28 @@
--- tests/bin/snoopy-test-threads.c.orig 2016-09-14 15:02:26 UTC
+++ tests/bin/snoopy-test-threads.c
@@ -25,7 +25,6 @@
/*
* Includes order: from local to global
*/
-#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
#include <snoopy.h>
@@ -42,7 +41,7 @@
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
-#include <wait.h>
+#include <sys/wait.h>
@@ -307,7 +306,7 @@ int randomNumberInclusive (int nMin, int
int randomNr;
// Seed
- rndSeed = (unsigned int) (pthread_self() + getpid() + syscall(SYS_gettid) + time(NULL));
+ rndSeed = (unsigned int) ((unsigned int)pthread_self() + getpid() + time(NULL));
srand(rndSeed);
// Generate

13
security/snoopy/pkg-plist Normal file
View File

@ -0,0 +1,13 @@
etc/snoopy.ini
lib/libsnoopy.so
lib/libsnoopy.so.0
lib/libsnoopy.so.0.0.0
sbin/snoopy-disable
sbin/snoopy-enable
%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTING.md
%%PORTDOCS%%%%DOCSDIR%%/ChangeLog
%%PORTDOCS%%%%DOCSDIR%%/FAQ.md
%%PORTDOCS%%%%DOCSDIR%%/FILTER_exclude_spawns_of.md
%%PORTDOCS%%%%DOCSDIR%%/HACKING.md
%%PORTDOCS%%%%DOCSDIR%%/INSTALL.md
%%PORTDOCS%%%%DOCSDIR%%/README.md