summaryrefslogtreecommitdiff
path: root/app-admin/syslog-ng
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-12-09 02:07:41 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-12-09 02:07:41 +0000
commit1a95f960273f276a4fdefb824336b073d83bcb5e (patch)
tree6adc7118c038d948a0e44ceb3095e09bc2cbe488 /app-admin/syslog-ng
parent494168b06b81a32b889c3cb1f721f925d0a6824f (diff)
gentoo auto-resync : 09:12:2024 - 02:07:41
Diffstat (limited to 'app-admin/syslog-ng')
-rw-r--r--app-admin/syslog-ng/Manifest2
-rw-r--r--app-admin/syslog-ng/files/syslog-ng-4.8.1-kmsg-invalid-argument.patch53
-rw-r--r--app-admin/syslog-ng/syslog-ng-4.8.1-r1.ebuild195
3 files changed, 250 insertions, 0 deletions
diff --git a/app-admin/syslog-ng/Manifest b/app-admin/syslog-ng/Manifest
index e86d7bce7e3d..e378e0a681ef 100644
--- a/app-admin/syslog-ng/Manifest
+++ b/app-admin/syslog-ng/Manifest
@@ -1,5 +1,6 @@
AUX README.hardened 358 BLAKE2B a816cf461b4c3553e979c309ced21537841e24ad805b67f43d5bf06fb77b86959a75c7680df87e7ded7fd72073ad469a06bdec1e739784c82776d04a91bd3add SHA512 75b4af1543436506e28d9b0e2625985ab864d1452604b1514ec030df822c36d90ae062508381610cc1f750082a52545f8678102dc475abff15f0f3c9a838128e
AUX syslog-ng-3.28.1-net-snmp.patch 292 BLAKE2B 7833709af12ab6531596bdb3b2c327fd2df3a5da3e3b00a597926f5bc5a1053dd2f37dbf0e89784946e169b9d3408c26da84b5355a309b76e424fc48f07ae4b6 SHA512 3b4b62b6e10fcca501891ce878202f1171c8f6bbd69098215015d1a9a1c571e11aa2d8d83d35145f0b5da9c6231952758b60a7116160d64d995d5b2b870b1904
+AUX syslog-ng-4.8.1-kmsg-invalid-argument.patch 1606 BLAKE2B fdb5976852aff8d0d8bb15c55ea00842f45712b76978fe5ea823882f39909902805391fad94ef4c22069b251b5350d635dbd7280c99213fb488ce5d48d8f7d60 SHA512 a7d460ca1e45c96eff29349b67d7a8f698ed1200eb01f91f4d65fedc6582817bd19b315da91cf16097908f0076313b7ec7e34b1e3e38a129137f3af50e86fe46
AUX syslog-ng.conf.gentoo.hardened.in 4509 BLAKE2B 39f130c008df8d5e31c121246997f8f31d2d8e2a78f1a881f4ca07ade0b3a5386c6e8c3fd8518e2ae471751564263886b8e3b78e8651efe0eeccd1d06c23c2a5 SHA512 0670952e6f5d0405e90bb5cb1ea168832bb2293095250c01a9baaf9e4fcdf8578ecf5b60809bd9e5089096a4d97fa966fcc47324fbe70cfd14266a10eb0001c6
AUX syslog-ng.conf.gentoo.hardened.in-r1 4510 BLAKE2B 9ac299ecb7bbdf24b50251bbd3b73da88f1a5b3bf99a8e360fb1fbef253d88543c011c84bdb1c290b558d8fc0249af6b70835a0fb74c0f6182b2cfbc60bf8b3b SHA512 5bb635b21343f8f3219bcf6c6dc2fed5e1d7235379304546959b657bc889af311938da88bc0f907de62067f96345a7e919f855caa6dac873d6922ea442b92405
AUX syslog-ng.conf.gentoo.in 1198 BLAKE2B a95b1fb9f46655502a41b0381c7388c9b54cfe9b8c3fd68dc68bd473175688e8ae72145a0ef718ef65220ecced7ecab00b39755cf41d4e21a6d375059cf6f309 SHA512 2830d1c5071a50c4aea6288b35c2880988111f29a11a641ee89f001a4ca4319943f87fdb1fd7079988888efa55401e2ed62f7a507c452de137f2e97a445d60e1
@@ -13,5 +14,6 @@ DIST syslog-ng-4.7.1.tar.gz 6877191 BLAKE2B b4a8fa1fe691b96d7e799e57542001829b32
DIST syslog-ng-4.8.1.tar.gz 6956412 BLAKE2B e545107a714e37b51f3c6f652c23a61615b7d3767b3d98ef364e630634c7512b4b08d6790e2635fdb5dab850a45808cd945629e838d3c66b07dfa63ee4d1d35a SHA512 5e20c28aa24deab95dac44edad1855d35d6f9ce474ff4249b3b5492405ff64c9694f40119fdc95b9db53f1aac6b598acc8096e26443caa53c27f7ad32528f9ea
EBUILD syslog-ng-4.6.0.ebuild 5299 BLAKE2B d2d453eb67314a57700f8ecfaa94eae172e3b47de41e7022bedc09c956f510d9ab85a021675fb1c5909a83acb113fd6cd7fec12af63e7f4ceef9c3b9bb0c2400 SHA512 0536ff638759b6bdc9982f7849a72573b36bb90bf43684661d634dfdf616185ddd84fe39f4f79035ef89b5391b9c2ad375615c6dd802866274f362618bf51ef4
EBUILD syslog-ng-4.7.1.ebuild 5363 BLAKE2B 9990591ff1f656478ef7facb613ed362cf711768c24392c4f239bee723fd65d03f909476818adf58a6072e596e90ac09a5136f61eddcab1085749cf994af00f6 SHA512 3d3089ae2085a0009c6b5545fa2cebe392eee1d5e31f6948665c93b36d33a228633f94c11f701bcadc2a35431197b8900714732ee049b4ae7374a4e3ec118cbc
+EBUILD syslog-ng-4.8.1-r1.ebuild 5461 BLAKE2B 8fcd48bb7e2962c6c806eab4a566ca71763ca6585e765ee9e814623a1e08c0834a58424c681c48066799462d6914d5a868adff7ecd5e2ba58ec9afa6d3c8c227 SHA512 c0dc482906872dafc7a8bc8b000d954176838f9aa9492d27cc7cf79ee0fcfc690ea357d5c4bcc70b47cb87bb5644f4d734b1c6aba9cedb29e0874da4031aee60
EBUILD syslog-ng-4.8.1.ebuild 5356 BLAKE2B 56932818d5b9e4470149215f9b8641037ebe3dcd9d134e87c7a7d708e60a151a02989175f56b3c9d3d4874af9d78a41c480534a634e463d7721d4547d4dc8a08 SHA512 8d3cbcf60504f4f62364927ceab434ca86e34745186c8b30d0e814d5e9cf433c0e4eeaccbf9f35ff382a8b8d3e5c457cc65bdfa94bc8ce263a13c488f7fa745c
MISC metadata.xml 1473 BLAKE2B 89d2c90327ef56334e99d081debd682538e25db7f26ec1d369912b67e8bb7b878412f167a1e1020a49baa5165fa2887103b0a3d021fe9c4502d2bd7b56ee681f SHA512 392d0702ddea668bd927cb89b06deaa532b2605d2f1caec46c5c00430dfa8bf3056f8050f7442501aad89c58813a9d1cfa6b46f904323711fc1800d9275702a5
diff --git a/app-admin/syslog-ng/files/syslog-ng-4.8.1-kmsg-invalid-argument.patch b/app-admin/syslog-ng/files/syslog-ng-4.8.1-kmsg-invalid-argument.patch
new file mode 100644
index 000000000000..75803d112de7
--- /dev/null
+++ b/app-admin/syslog-ng/files/syslog-ng-4.8.1-kmsg-invalid-argument.patch
@@ -0,0 +1,53 @@
+From 2cd1f3abaf077aa0f14de967db55993c06bdad06 Mon Sep 17 00:00:00 2001
+From: Hofi <hofione@gmail.com>
+Date: Fri, 8 Nov 2024 15:46:00 +0100
+Subject: [PATCH] file-reader: added a more detailed, direct check if seek can
+ be called on the file descriptor
+
+Signed-off-by: Hofi <hofione@gmail.com>
+---
+ modules/affile/file-reader.c | 22 +++++++++++++++++++---
+ 1 file changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/modules/affile/file-reader.c b/modules/affile/file-reader.c
+index 712bac5c91..203c2086d3 100644
+--- a/modules/affile/file-reader.c
++++ b/modules/affile/file-reader.c
+@@ -163,10 +163,26 @@ _recover_state(LogPipe *s, GlobalConfig *cfg, LogProtoServer *proto)
+ }
+
+ static gboolean
+-_can_check_eof(gint fd)
++_can_check_eof(FileReader *self, gint fd)
+ {
+ struct stat st;
+- return fstat(fd, &st) == 0 && S_ISFIFO(st.st_mode) == 0;
++
++ if (fstat(fd, &st) == -1 || S_ISFIFO(st.st_mode) || S_ISSOCK(st.st_mode) || S_ISCHR(st.st_mode))
++ return FALSE;
++
++ off_t pos = lseek(fd, 0, SEEK_CUR);
++ if (pos == -1)
++ return FALSE;
++
++ off_t reset = lseek(fd, pos, SEEK_SET);
++ if (reset != pos)
++ {
++ msg_trace("File seek pos is different after testing if seekable",
++ evt_tag_str("follow_filename", self->filename->str),
++ evt_tag_int("fn", fd));
++ }
++
++ return TRUE;
+ }
+
+ static gboolean
+@@ -263,7 +279,7 @@ _construct_poll_events(FileReader *self, gint fd)
+ return NULL;
+ }
+
+- if (_can_check_eof(fd))
++ if (_can_check_eof(self, fd))
+ poll_events_set_checker(poll_events, _reader_check_watches, self);
+
+ return poll_events;
diff --git a/app-admin/syslog-ng/syslog-ng-4.8.1-r1.ebuild b/app-admin/syslog-ng/syslog-ng-4.8.1-r1.ebuild
new file mode 100644
index 000000000000..afc80939e2b7
--- /dev/null
+++ b/app-admin/syslog-ng/syslog-ng-4.8.1-r1.ebuild
@@ -0,0 +1,195 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+inherit autotools python-single-r1 systemd
+
+DESCRIPTION="syslog replacement with advanced filtering features"
+HOMEPAGE="https://www.syslog-ng.com/products/open-source-log-management/"
+SRC_URI="https://github.com/syslog-ng/syslog-ng/releases/download/${P}/${P}.tar.gz"
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="amqp caps dbi geoip2 grpc http json kafka mongodb mqtt pacct python redis smtp snmp test spoof-source systemd tcpd"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
+ test? ( python )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ >=dev-libs/glib-2.10.1:2
+ >=dev-libs/ivykis-0.42.4
+ >=dev-libs/libpcre2-10.0:=
+ dev-libs/openssl:0=
+ !dev-libs/eventlog
+ >=dev-libs/json-c-0.9:=
+ amqp? ( >=net-libs/rabbitmq-c-0.8.0:=[ssl] )
+ caps? ( sys-libs/libcap )
+ dbi? ( >=dev-db/libdbi-0.9.0 )
+ geoip2? ( dev-libs/libmaxminddb:= )
+ grpc? (
+ dev-libs/protobuf:=
+ net-libs/grpc:=
+ )
+ http? ( net-misc/curl )
+ kafka? ( >=dev-libs/librdkafka-1.0.0:= )
+ mongodb? ( >=dev-libs/mongo-c-driver-1.2.0 )
+ mqtt? ( net-libs/paho-mqtt-c:1.3 )
+ python? (
+ ${PYTHON_DEPS}
+ $(python_gen_cond_dep '
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ ')
+ )
+ redis? ( >=dev-libs/hiredis-0.11.0:= )
+ smtp? ( net-libs/libesmtp:= )
+ snmp? ( net-analyzer/net-snmp:0= )
+ spoof-source? ( net-libs/libnet:1.1 )
+ systemd? ( sys-apps/systemd:= )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )"
+DEPEND="${RDEPEND}
+ test? ( dev-libs/criterion )"
+BDEPEND="
+ >=sys-devel/bison-3.7.6
+ sys-devel/flex
+ virtual/pkgconfig
+ grpc? ( dev-libs/protobuf:= )"
+
+DOCS=( AUTHORS NEWS.md CONTRIBUTING.md contrib/syslog-ng.conf.{HP-UX,RedHat,SunOS,doc}
+ contrib/syslog2ng "${T}/syslog-ng.conf.gentoo.hardened"
+ "${T}/syslog-ng.logrotate.hardened" "${FILESDIR}/README.hardened" )
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.28.1-net-snmp.patch
+ "${FILESDIR}"/${PN}-4.8.1-kmsg-invalid-argument.patch
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ local f
+
+ # disable python-modules test as it requires additional python modules not
+ # packaged in Gentoo
+ sed -i '/MAKE/s/.*/exit 0/g' modules/python-modules/test_pymodules.sh || die
+
+ use python && python_fix_shebang .
+
+ # remove bundled libs
+ rm -r lib/ivykis || die
+
+ # drop scl modules requiring json
+ if use !json; then
+ sed -i -r '/cim|elasticsearch|ewmm|graylog2|loggly|logmatic|netskope|nodejs|osquery|slack/d' scl/Makefile.am || die
+ fi
+
+ # drop scl modules requiring http
+ if use !http; then
+ sed -i -r '/slack|telegram/d' scl/Makefile.am || die
+ fi
+
+ # use gentoo default path
+ if use systemd; then
+ sed -e 's@/etc/syslog-ng.conf@/etc/syslog-ng/syslog-ng.conf@g;s@/var/run@/run@g' \
+ -i contrib/systemd/syslog-ng@default || die
+ fi
+
+ for f in syslog-ng.logrotate.hardened.in syslog-ng.logrotate.in; do
+ sed \
+ -e "s#@GENTOO_RESTART@#$(usex systemd "systemctl kill -s HUP syslog-ng@default" \
+ "/etc/init.d/syslog-ng reload")#g" \
+ "${FILESDIR}/${f}" > "${T}/${f/.in/}" || die
+ done
+
+ for f in syslog-ng.conf.gentoo.hardened.in-r1 \
+ syslog-ng.conf.gentoo.in-r1; do
+ sed -e "s/@SYSLOGNG_VERSION@/$(ver_cut 1-2)/g" "${FILESDIR}/${f}" > "${T}/${f/.in-r1/}" || die
+ done
+
+ default
+ eautoreconf
+}
+
+src_configure() {
+ # Needs bison/flex.
+ unset YACC LEX
+
+ local myconf=(
+ --disable-docs
+ --disable-java
+ --disable-java-modules
+ --disable-riemann
+ --enable-ipv6
+ --enable-manpages
+ --localstatedir=/var/lib/syslog-ng
+ --sysconfdir=/etc/syslog-ng
+ --with-embedded-crypto
+ --with-ivykis=system
+ --with-module-dir=/usr/$(get_libdir)/syslog-ng
+ --with-pidfile-dir=/var/run
+ --with-python-packages=none
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ $(use_enable amqp)
+ $(use_with amqp librabbitmq-client system)
+ $(use_enable caps linux-caps)
+ $(use_enable dbi sql)
+ $(use_enable geoip2)
+ $(use_enable grpc)
+ $(use_enable grpc cpp)
+ $(use_enable http)
+ $(use_enable json)
+ $(use_enable kafka)
+ $(use_enable mongodb)
+ $(use_enable mqtt)
+ $(usex mongodb --with-mongoc=system "--without-mongoc --disable-legacy-mongodb-options")
+ $(use_enable pacct)
+ $(use_enable python)
+ $(use_enable redis)
+ $(use_enable smtp)
+ $(use_enable snmp afsnmp)
+ $(use_enable spoof-source)
+ $(use_enable systemd)
+ $(use_enable tcpd tcp-wrapper)
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+
+ # Install default configuration
+ insinto /etc/default
+ doins contrib/systemd/syslog-ng@default
+
+ insinto /etc/syslog-ng
+ newins "${T}/syslog-ng.conf.gentoo" syslog-ng.conf
+
+ insinto /etc/logrotate.d
+ newins "${T}/syslog-ng.logrotate" syslog-ng
+
+ newinitd "${FILESDIR}/syslog-ng.rc" syslog-ng
+ newconfd "${FILESDIR}/syslog-ng.confd" syslog-ng
+ keepdir /etc/syslog-ng/patterndb.d /var/lib/syslog-ng
+ find "${D}" -name '*.la' -delete || die
+
+ use python && python_optimize "${ED}/usr/$(get_libdir)/syslog-ng/python"
+}
+
+pkg_postinst() {
+ # bug #355257
+ if ! has_version app-admin/logrotate ; then
+ elog "It is highly recommended that app-admin/logrotate be emerged to"
+ elog "manage the log files. ${PN} installs a file in /etc/logrotate.d"
+ elog "for logrotate to use."
+ fi
+
+ if use systemd; then
+ ewarn "The service file for systemd has changed to support multiple instances."
+ ewarn "To start the default instance issue:"
+ ewarn "# systemctl start syslog-ng@default"
+ fi
+}