public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/ossec-hids/, net-analyzer/ossec-hids/files/
@ 2018-10-30 10:27 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2018-10-30 10:27 UTC (permalink / raw
  To: gentoo-commits

commit:     9fcab634ffa351e9821d8ae2539aef280f751a25
Author:     Ralph Seichter <github <AT> seichter <DOT> de>
AuthorDate: Sat Oct 20 19:30:21 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct 30 10:27:49 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fcab634

net-analyzer/ossec-hids: open source HIDS (new package)

OSSEC is a full platform to monitor and control your systems. It mixes
together all the aspects of HIDS (host-based intrusion detection), log
monitoring and SIM/SIEM together in a simple, powerful and open source
solution.

Signed-off-by: Ralph Seichter <gentoo <AT> seichter.de>
Closes: https://bugs.gentoo.org/545788
Package-Manager: Portage-2.3.49, Repoman-2.3.11
Closes: https://github.com/gentoo/gentoo/pull/10189
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 net-analyzer/ossec-hids/Manifest                |  1 +
 net-analyzer/ossec-hids/files/makefile.patch    | 28 ++++++++++
 net-analyzer/ossec-hids/metadata.xml            | 30 +++++++++++
 net-analyzer/ossec-hids/ossec-hids-3.1.0.ebuild | 68 +++++++++++++++++++++++++
 4 files changed, 127 insertions(+)

diff --git a/net-analyzer/ossec-hids/Manifest b/net-analyzer/ossec-hids/Manifest
new file mode 100644
index 00000000000..f36a96f0d3e
--- /dev/null
+++ b/net-analyzer/ossec-hids/Manifest
@@ -0,0 +1 @@
+DIST ossec-hids-3.1.0.tar.gz 1886469 BLAKE2B c175c8659a8b5d0d269a5cb6bf142276f29e6f676afc6029accf854d68299d71147ba65a667601e77c6db8ca49a29afa49534e5683369f420f6389059ae61fc3 SHA512 fe55f82ac354d9fcd767d8379a492279644308788535780bb029d46688c93f259771686462570137555b40082c6756daad44bbdd1ddc953ed0bb22b65c6cb566

diff --git a/net-analyzer/ossec-hids/files/makefile.patch b/net-analyzer/ossec-hids/files/makefile.patch
new file mode 100644
index 00000000000..2169b5287fd
--- /dev/null
+++ b/net-analyzer/ossec-hids/files/makefile.patch
@@ -0,0 +1,28 @@
+--- a/Makefile	2018-10-12 00:25:16.000000000 +0200
++++ b/Makefile	2018-10-26 17:59:44.458689842 +0200
+@@ -378,7 +378,6 @@
+ install-server: install-server-generic
+ 
+ install-common: build
+-	./init/adduser.sh ${OSSEC_USER} ${OSSEC_USER_MAIL} ${OSSEC_USER_REM} ${OSSEC_GROUP} ${PREFIX}
+ 	install -d -m 0550 -o root -g ${OSSEC_GROUP} ${PREFIX}/
+ 	install -d -m 0750 -o ${OSSEC_USER} -g ${OSSEC_GROUP} ${PREFIX}/logs
+ 	install -m 0660 -o ${OSSEC_USER} -g ${OSSEC_GROUP} /dev/null ${PREFIX}/logs/ossec.log
+@@ -1166,7 +1165,7 @@
+ #### test ##########
+ ####################
+ 
+-CFLAGS_TEST = -g -O0 --coverage
++CFLAGS_TEST = -g -O0
+ 
+ LDFLAGS_TEST = -lcheck -lm -pthread -lrt
+ 
+@@ -1177,7 +1176,7 @@
+ 
+ test_programs = test_os_zlib test_os_xml test_os_regex test_os_crypto test_shared
+ 
+-.PHONY: test run_tests build_tests test_valgrind test_coverage
++.PHONY: test run_tests build_tests test_valgrind
+ 
+ test: build_tests
+ 	${MAKE} run_tests

diff --git a/net-analyzer/ossec-hids/metadata.xml b/net-analyzer/ossec-hids/metadata.xml
new file mode 100644
index 00000000000..a6ba742f6ee
--- /dev/null
+++ b/net-analyzer/ossec-hids/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>gentoo@seichter.de</email>
+		<name>Ralph Seichter</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<longdescription>
+		OSSEC is a full platform to monitor and control your systems. It mixes
+		together all the aspects of HIDS (host-based intrusion detection), log
+		monitoring and SIM/SIEM together in a simple, powerful and open source
+		solution.
+		To determine which build target (agent, server, hybrid or local) best
+		suits your needs, please visit https://www.ossec.net/ and review the
+		documentation provided there.
+	</longdescription>
+	<use>
+		<flag name="agent">Build "agent" installation target (see package description)</flag>
+		<flag name="hybrid">Build "hybrid" installation target</flag>
+		<flag name="local">Build "local" installation target</flag>
+		<flag name="server">Build "server" installation target</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">ossec/ossec-hids</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/net-analyzer/ossec-hids/ossec-hids-3.1.0.ebuild b/net-analyzer/ossec-hids/ossec-hids-3.1.0.ebuild
new file mode 100644
index 00000000000..9df4ea46973
--- /dev/null
+++ b/net-analyzer/ossec-hids/ossec-hids-3.1.0.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit user
+
+DESCRIPTION="Open Source Host-based Intrusion Detection System"
+HOMEPAGE="https://www.ossec.net/"
+SRC_URI="https://github.com/ossec/ossec-hids/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="agent hybrid local mysql postgres server sqlite"
+REQUIRED_USE="^^ ( agent hybrid local server )
+	?? ( mysql postgres )"
+
+DEPEND="mysql? ( virtual/mysql )
+	sqlite? ( dev-db/sqlite:3 )
+	postgres? ( dev-db/postgresql:= )
+	sys-libs/zlib:="
+RDEPEND="${DEPEND}"
+S="${WORKDIR}/${P}/src"
+
+declare -a MY_OPT
+
+pkg_setup() {
+	enewuser ossec -1 -1 /var/ossec
+	enewuser ossecm -1 -1 -1 ossec
+	enewuser ossecr -1 -1 -1 ossec
+}
+
+src_prepare() {
+	default
+	eapply "${FILESDIR}/makefile.patch"
+}
+
+src_configure() {
+	local target="local"
+	use agent && target="agent"
+	use hybrid && target="hybrid"
+	use server && target="server"
+	MY_OPT=(
+		TARGET=${target}
+		USE_SQLITE=$(usex sqlite)
+		V=0
+		ZLIB_SYSTEM=yes
+	)
+	use mysql && MY_OPT+=( DATABASE=mysql )
+	use postgres && MY_OPT+=( DATABASE=pgsql )
+}
+
+src_compile() {
+	emake "${MY_OPT[@]}" PREFIX=/var/ossec
+}
+
+src_test() {
+	emake "${MY_OPT[@]}" PREFIX=/var/ossec test
+}
+
+src_install() {
+	keepdir /var/ossec/logs/{alerts,archives,firewall}
+	keepdir /var/ossec/lua/{compiled,native}
+	keepdir /var/ossec/queue/{agent-info,agentless,alerts,diff,fts,ossec,rids,rootcheck,syscheck}
+	keepdir /var/ossec/{.ssh,stats,tmp,var/run}
+	emake "${MY_OPT[@]}" PREFIX="${D}/var/ossec" install
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/ossec-hids/, net-analyzer/ossec-hids/files/
@ 2019-07-05 17:30 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2019-07-05 17:30 UTC (permalink / raw
  To: gentoo-commits

commit:     cc56e191d778f684fd3da1ae45c10e1ff3cd2f9e
Author:     Ralph Seichter <github <AT> seichter <DOT> de>
AuthorDate: Fri Jun 28 17:29:32 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  5 17:30:26 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc56e191

net-analyzer/ossec-hids: Fix build issue, version bump

Added enewgroup to fix bug #688892. Updated to release 3.3.0.

Closes: https://bugs.gentoo.org/688892
Signed-off-by: Ralph Seichter <gentoo <AT> seichter.de>
Package-Manager: Portage-2.3.66, Repoman-2.3.11
Closes: https://github.com/gentoo/gentoo/pull/12350
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 net-analyzer/ossec-hids/Manifest                   |  1 +
 net-analyzer/ossec-hids/files/makefile-3.3.0.patch | 28 +++++++++
 net-analyzer/ossec-hids/ossec-hids-3.3.0.ebuild    | 67 ++++++++++++++++++++++
 3 files changed, 96 insertions(+)

diff --git a/net-analyzer/ossec-hids/Manifest b/net-analyzer/ossec-hids/Manifest
index 9fd4fe3f66d..e33470f61e0 100644
--- a/net-analyzer/ossec-hids/Manifest
+++ b/net-analyzer/ossec-hids/Manifest
@@ -1,2 +1,3 @@
 DIST ossec-hids-3.1.0.tar.gz 1886469 BLAKE2B c175c8659a8b5d0d269a5cb6bf142276f29e6f676afc6029accf854d68299d71147ba65a667601e77c6db8ca49a29afa49534e5683369f420f6389059ae61fc3 SHA512 fe55f82ac354d9fcd767d8379a492279644308788535780bb029d46688c93f259771686462570137555b40082c6756daad44bbdd1ddc953ed0bb22b65c6cb566
 DIST ossec-hids-3.2.0.tar.gz 1896977 BLAKE2B d77cff3a3a72287ad2235f346c7d07cfdad83872d956f57877ed44ad21bb717e4b4ddcfd0e8b2ce45cb90160bb63a28a7d06bc6225b53cc5ed42f7a97c5a1765 SHA512 40b25b97c43a66b8a145914ab0badd9d4f7de7d2168aa7a49abdf778c620a4b533ce3de0883d26c4c39816cf78674a053788a57c5f9c38fbea7cd8b13a35d18f
+DIST ossec-hids-3.3.0.tar.gz 1900070 BLAKE2B a18a1e55ba44450c634b59099f10b674d27b2079ff456a034dc7bb4bbaf3c89b96f197515f3fb7aa54c248643f333e830a519b04cd4a9402cec2c32597fd96b2 SHA512 97c7e7b21ce88a3f1c89b79ff74b0c13804ba313cf3f30b98bcb4011f422ca050876e780c30624812d399d6b5c59629e52f6772b9ee0cd7cead1d66044dca627

diff --git a/net-analyzer/ossec-hids/files/makefile-3.3.0.patch b/net-analyzer/ossec-hids/files/makefile-3.3.0.patch
new file mode 100644
index 00000000000..810bc077d43
--- /dev/null
+++ b/net-analyzer/ossec-hids/files/makefile-3.3.0.patch
@@ -0,0 +1,28 @@
+--- a/Makefile	2019-03-09 16:33:13.465947636 +0100
++++ b/Makefile	2019-03-09 16:32:57.105946856 +0100
+@@ -370,7 +370,6 @@
+ install-server: install-server-generic
+ 
+ install-common: build
+-	./init/adduser.sh ${OSSEC_USER} ${OSSEC_USER_MAIL} ${OSSEC_USER_REM} ${OSSEC_GROUP} ${PREFIX}
+ 	$(call INSTALL_CMD,0550,root,${OSSEC_GROUP}) -d ${PREFIX}/
+ 	$(call INSTALL_CMD,0750,${OSSEC_USER},${OSSEC_GROUP}) -d ${PREFIX}/logs
+ 	$(call INSTALL_CMD,0660,${OSSEC_USER},${OSSEC_GROUP}) /dev/null ${PREFIX}/logs/ossec.log
+@@ -1160,7 +1159,7 @@
+ #### test ##########
+ ####################
+ 
+-CFLAGS_TEST = -g -O0 --coverage
++CFLAGS_TEST = -g -O0
+ 
+ LDFLAGS_TEST = -lcheck -lm -pthread -lrt
+ 
+@@ -1171,7 +1170,7 @@
+ 
+ test_programs = test_os_zlib test_os_xml test_os_regex test_os_crypto test_shared
+ 
+-.PHONY: test run_tests build_tests test_valgrind test_coverage
++.PHONY: test run_tests build_tests test_valgrind
+ 
+ test: build_tests
+ 	${MAKE} run_tests

diff --git a/net-analyzer/ossec-hids/ossec-hids-3.3.0.ebuild b/net-analyzer/ossec-hids/ossec-hids-3.3.0.ebuild
new file mode 100644
index 00000000000..c9b83c7daa3
--- /dev/null
+++ b/net-analyzer/ossec-hids/ossec-hids-3.3.0.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit user
+
+DESCRIPTION="Open Source Host-based Intrusion Detection System"
+HOMEPAGE="https://www.ossec.net/"
+SRC_URI="https://github.com/ossec/ossec-hids/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="agent hybrid local mysql postgres server sqlite"
+REQUIRED_USE="^^ ( agent hybrid local server )
+	?? ( mysql postgres )"
+
+DEPEND="dev-libs/libpcre2
+	mysql? ( virtual/mysql )
+	sqlite? ( dev-db/sqlite:3 )
+	postgres? ( dev-db/postgresql:= )"
+RDEPEND="${DEPEND}"
+S="${WORKDIR}/${P}/src"
+PATCHES=( "${FILESDIR}/makefile-${PV}.patch" )
+
+declare -a MY_OPT
+
+pkg_setup() {
+	enewgroup ossec
+	enewuser ossec -1 -1 /var/ossec ossec
+	enewuser ossecm -1 -1 -1 ossec
+	enewuser ossecr -1 -1 -1 ossec
+}
+
+src_configure() {
+	local target="local"
+	use agent && target="agent"
+	use hybrid && target="hybrid"
+	use server && target="server"
+	MY_OPT=(
+		PCRE2_SYSTEM=yes
+		TARGET=${target}
+		USE_SQLITE=$(usex sqlite)
+		V=0
+		ZLIB_SYSTEM=yes
+	)
+	use mysql && MY_OPT+=( DATABASE=mysql )
+	use postgres && MY_OPT+=( DATABASE=pgsql )
+}
+
+src_compile() {
+	emake "${MY_OPT[@]}" PREFIX=/var/ossec
+}
+
+src_test() {
+	emake "${MY_OPT[@]}" PREFIX=/var/ossec test
+}
+
+src_install() {
+	keepdir /var/ossec/logs/{alerts,archives,firewall}
+	keepdir /var/ossec/lua/{compiled,native}
+	keepdir /var/ossec/queue/{agent-info,agentless,alerts,diff,fts,ossec,rids,rootcheck,syscheck}
+	keepdir /var/ossec/{.ssh,stats,tmp,var/run}
+	newenvd - 50ossec-hids <<<'CONFIG_PROTECT="/var/ossec/etc"'
+	emake "${MY_OPT[@]}" PREFIX="${D}/var/ossec" install
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/ossec-hids/, net-analyzer/ossec-hids/files/
@ 2020-06-04 17:05 Aaron Bauman
  0 siblings, 0 replies; 3+ messages in thread
From: Aaron Bauman @ 2020-06-04 17:05 UTC (permalink / raw
  To: gentoo-commits

commit:     cc3444458dded272e5f8313f7ec2762af2f11f6c
Author:     Ralph Seichter <github <AT> seichter <DOT> de>
AuthorDate: Sun May 24 15:02:32 2020 +0000
Commit:     Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Thu Jun  4 17:05:32 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc344445

net-analyzer/ossec-hids: Add GCC -fno-common fix

Add an upstream-provided fix for the impending GCC-10 change regarding
the -fno-common flag.

Bugs: https://bugs.gentoo.org/720088
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Ralph Seichter <gentoo <AT> seichter.de>
Closes: https://github.com/gentoo/gentoo/pull/15953
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>

 .../ossec-hids/files/gcc-fno-common-3.6.0.patch    | 402 +++++++++++++++++++++
 net-analyzer/ossec-hids/ossec-hids-3.6.0.ebuild    |   9 +-
 2 files changed, 410 insertions(+), 1 deletion(-)

diff --git a/net-analyzer/ossec-hids/files/gcc-fno-common-3.6.0.patch b/net-analyzer/ossec-hids/files/gcc-fno-common-3.6.0.patch
new file mode 100644
index 00000000000..e8ed3c66dd9
--- /dev/null
+++ b/net-analyzer/ossec-hids/files/gcc-fno-common-3.6.0.patch
@@ -0,0 +1,402 @@
+diff --git a/src/addagent/main.c b/src/addagent/main.c
+index 587a8a3d8..ab12f0326 100644
+--- a/src/addagent/main.c
++++ b/src/addagent/main.c
+@@ -17,6 +17,7 @@ static void print_banner(void);
+ static void manage_shutdown(int sig) __attribute__((noreturn));
+ #endif
+ 
++int willchroot;
+ 
+ #if defined(__MINGW32__)
+ static int setenv(const char *name, const char *val, __attribute__((unused)) int overwrite)
+diff --git a/src/addagent/manage_agents.c b/src/addagent/manage_agents.c
+index ac39c1e66..4f9c266ff 100644
+--- a/src/addagent/manage_agents.c
++++ b/src/addagent/manage_agents.c
+@@ -85,6 +85,8 @@ int add_agent(int json_output)
+ 
+     char authfile[257];
+ 
++    extern int willchroot;
++
+     if(willchroot > 0) {
+         snprintf(authfile, 256, "%s", AUTH_FILE);	//XXX
+     } else {
+diff --git a/src/addagent/manage_agents.h b/src/addagent/manage_agents.h
+index 4812dba43..f2962e80b 100644
+--- a/src/addagent/manage_agents.h
++++ b/src/addagent/manage_agents.h
+@@ -147,4 +147,4 @@ extern fpos_t fp_pos;
+ #define GMF_UNKN_ERROR  ARGV0 ": Could not run GetModuleFileName which returned (%ld).\n"
+ 
+ 
+-int willchroot;
++//int willchroot;
+diff --git a/src/addagent/manage_keys.c b/src/addagent/manage_keys.c
+index 146b48326..ffb9a1f21 100644
+--- a/src/addagent/manage_keys.c
++++ b/src/addagent/manage_keys.c
+@@ -336,6 +336,8 @@ int k_bulkload(const char *cmdbulk)
+     char delims[] = ",";
+     char *token = NULL;
+ 
++    extern int willchroot;
++
+     /* Check if we can open the input file */
+     printf("Opening: [%s]\n", cmdbulk);
+     infp = fopen(cmdbulk, "r");
+diff --git a/src/analysisd/analysisd.c b/src/analysisd/analysisd.c
+index a220f4421..0a81971de 100644
+--- a/src/analysisd/analysisd.c
++++ b/src/analysisd/analysisd.c
+@@ -42,7 +42,12 @@
+ #endif
+ 
+ #ifdef SQLITE_ENABLED
+-#include "syscheck-sqlite.h"
++#include <sqlite3.h>
++sqlite3 *conn;
++#endif
++
++#ifdef LIBGEOIP_ENABLED
++GeoIP *geoipdb;
+ #endif
+ 
+ /** Prototypes **/
+diff --git a/src/analysisd/config.h b/src/analysisd/config.h
+index 8d74c756e..976d1942e 100644
+--- a/src/analysisd/config.h
++++ b/src/analysisd/config.h
+@@ -12,6 +12,7 @@
+ 
+ #include "config/config.h"
+ #include "config/global-config.h"
++
+ #ifdef LIBGEOIP_ENABLED
+ #include "GeoIP.h"
+ #endif
+@@ -20,9 +21,11 @@
+ extern long int __crt_ftell; /* Global ftell pointer */
+ extern _Config Config;       /* Global Config structure */
+ 
++/*
+ #ifdef LIBGEOIP_ENABLED
+ GeoIP *geoipdb;
+ #endif
++*/
+ 
+ int GlobalConf(const char *cfgfile);
+ 
+diff --git a/src/analysisd/decoders/geoip.c b/src/analysisd/decoders/geoip.c
+index 464e4bb71..9816b4c81 100644
+--- a/src/analysisd/decoders/geoip.c
++++ b/src/analysisd/decoders/geoip.c
+@@ -30,6 +30,7 @@ char *GetGeoInfobyIP(char *ip_addr)
+     GeoIPRecord *geoiprecord;
+     char *geodata = NULL;
+     char geobuffer[256 +1];
++    extern GeoIP *geoipdb;
+ 
+     if(!geoipdb)
+     {
+diff --git a/src/analysisd/decoders/syscheck.c b/src/analysisd/decoders/syscheck.c
+index a6d675892..30339a00d 100644
+--- a/src/analysisd/decoders/syscheck.c
++++ b/src/analysisd/decoders/syscheck.c
+@@ -16,7 +16,7 @@
+ #include "decoder.h"
+ 
+ #ifdef SQLITE_ENABLED
+-#include "syscheck-sqlite.h"
++#include <sqlite3.h>
+ #endif
+ 
+ typedef struct __sdb {
+diff --git a/src/analysisd/makelists.c b/src/analysisd/makelists.c
+index 06c90db70..dfbe6a4a3 100644
+--- a/src/analysisd/makelists.c
++++ b/src/analysisd/makelists.c
+@@ -32,6 +32,10 @@ time_t c_time;
+ char __shost[512];
+ OSDecoderInfo *NULL_Decoder;
+ 
++#ifdef LIBGEOIP_ENABLED
++GeoIP *geoipdb;
++#endif
++
+ /* print help statement */
+ __attribute__((noreturn))
+ static void help_makelists(void)
+diff --git a/src/analysisd/syscheck-sqlite.h b/src/analysisd/syscheck-sqlite.h
+deleted file mode 100644
+index 526cab26e..000000000
+--- a/src/analysisd/syscheck-sqlite.h
++++ /dev/null
+@@ -1,5 +0,0 @@
+-#ifdef SQLITE_ENABLED
+-#include <sqlite3.h>
+-
+-sqlite3 *conn;
+-#endif
+diff --git a/src/analysisd/testrule.c b/src/analysisd/testrule.c
+index c08fb4885..b1aa928f7 100644
+--- a/src/analysisd/testrule.c
++++ b/src/analysisd/testrule.c
+@@ -83,6 +83,7 @@ int main(int argc, char **argv)
+     memset(prev_month, '\0', 4);
+ 
+ #ifdef LIBGEOIP_ENABLED
++    extern GeoIP *geoipdb;
+     geoipdb = NULL;
+ #endif
+ 
+diff --git a/src/client-agent/agentd.c b/src/client-agent/agentd.c
+index c09cf87d3..67828e79c 100644
+--- a/src/client-agent/agentd.c
++++ b/src/client-agent/agentd.c
+@@ -23,6 +23,8 @@ void AgentdStart(const char *dir, int uid, int gid, const char *user, const char
+     fd_set fdset;
+     struct timeval fdtimeout;
+ 
++    extern agent *agt;
++
+     available_server = 0;
+ 
+     /* Initial random numbers must happen before chroot */
+diff --git a/src/client-agent/agentd.h b/src/client-agent/agentd.h
+index 0246a5457..a362ff9a3 100644
+--- a/src/client-agent/agentd.h
++++ b/src/client-agent/agentd.h
+@@ -81,9 +81,9 @@ void os_agent_cb(int fd, short ev, void *arg);
+ extern time_t available_server;
+ extern int run_foreground;
+ extern keystore keys;
+-extern agent *agt;
++//extern agent *agt;
+ #ifndef WIN32
+-struct imsgbuf server_ibuf;
++//struct imsgbuf server_ibuf;
+ #endif //WIN32
+ 
+ #endif /* __AGENTD_H */
+diff --git a/src/client-agent/event-forward.c b/src/client-agent/event-forward.c
+index 2e81f0c90..22ed0beb9 100644
+--- a/src/client-agent/event-forward.c
++++ b/src/client-agent/event-forward.c
+@@ -19,6 +19,9 @@
+ /* Receive a message locally on the agent and forward it to the manager */
+ void *EventForward(void)
+ {
++
++    extern agent *agt;
++
+     ssize_t recv_b;
+     char msg[OS_MAXSTR + 1];
+ 
+diff --git a/src/client-agent/main.c b/src/client-agent/main.c
+index 5f85cfb73..01c18970c 100644
+--- a/src/client-agent/main.c
++++ b/src/client-agent/main.c
+@@ -16,7 +16,8 @@
+ #define ARGV0 "ossec-agentd"
+ #endif
+ 
+-extern struct imsgbuf server_ibuf;
++//extern struct imsgbuf server_ibuf;
++struct imsgbuf server_ibuf;
+ 
+ 
+ /* Prototypes */
+@@ -112,6 +113,8 @@ int main(int argc, char **argv)
+ 
+     debug1(STARTED_MSG, ARGV0);
+ 
++    extern agent *agt;
++
+     agt = (agent *)calloc(1, sizeof(agent));
+     if (!agt) {
+         ErrorExit(MEM_ERROR, ARGV0, errno, strerror(errno));
+diff --git a/src/client-agent/notify.c b/src/client-agent/notify.c
+index 1b239f26c..93fec325c 100644
+--- a/src/client-agent/notify.c
++++ b/src/client-agent/notify.c
+@@ -68,6 +68,8 @@ void run_notify()
+     os_md5 md5sum;
+     time_t curr_time;
+ 
++    extern agent *agt;
++
+     keep_alive_random[0] = '\0';
+     curr_time = time(0);
+ 
+diff --git a/src/client-agent/receiver-win.c b/src/client-agent/receiver-win.c
+index 859bdf7f9..4ab62ee77 100644
+--- a/src/client-agent/receiver-win.c
++++ b/src/client-agent/receiver-win.c
+@@ -19,6 +19,7 @@
+ /* Receive events from the server */
+ void *receiver_thread(__attribute__((unused)) void *none)
+ {
++    extern agent *agt;
+     int recv_b;
+ 
+     char file[OS_SIZE_1024 + 1];
+diff --git a/src/client-agent/receiver.c b/src/client-agent/receiver.c
+index fde64c282..5286e60dc 100644
+--- a/src/client-agent/receiver.c
++++ b/src/client-agent/receiver.c
+@@ -29,6 +29,8 @@ void *receive_msg()
+     char cleartext[OS_MAXSTR + 1];
+     char *tmp_msg;
+ 
++    extern agent *agt;
++
+     memset(cleartext, '\0', OS_MAXSTR + 1);
+     memset(buffer, '\0', OS_MAXSTR + 1);
+ 
+diff --git a/src/client-agent/sendmsg.c b/src/client-agent/sendmsg.c
+index 454c2e714..3076dfcf9 100644
+--- a/src/client-agent/sendmsg.c
++++ b/src/client-agent/sendmsg.c
+@@ -15,6 +15,9 @@
+ /* Send a message to the server */
+ int send_msg(int agentid, const char *msg)
+ {
++
++    extern agent *agt;
++
+     size_t msg_size;
+     char crypt_msg[OS_MAXSTR + 1];
+ 
+diff --git a/src/client-agent/start_agent.c b/src/client-agent/start_agent.c
+index 51670cee5..f1df43715 100644
+--- a/src/client-agent/start_agent.c
++++ b/src/client-agent/start_agent.c
+@@ -24,6 +24,9 @@ int connect_server(int initial_id)
+ #ifdef WIN32
+     unsigned int attempts = 2;
+ #endif //WIN32
++
++    extern agent *agt;
++
+     int rc = initial_id;
+ 
+     /* Checking if the initial is zero, meaning we have to
+@@ -139,6 +142,8 @@ void start_agent(int is_startup)
+     char cleartext[OS_MAXSTR + 1];
+     char fmsg[OS_MAXSTR + 1];
+ 
++    extern agent *agt;
++
+     memset(msg, '\0', OS_MAXSTR + 2);
+     memset(buffer, '\0', OS_MAXSTR + 1);
+     memset(cleartext, '\0', OS_MAXSTR + 1);
+@@ -241,6 +246,8 @@ void os_agent_cb(int fd, short ev, void *arg) {
+     struct imsg imsg;
+     struct imsgbuf *ibuf = (struct imsgbuf *)arg;
+ 
++    extern agent *agt;
++
+     if (ev & EV_READ) {
+         if ((n = imsg_read(ibuf) == -1 && errno != EAGAIN)) {
+             ErrorExit("%s: ERROR: imsg_read() failed: %s", ARGV0, strerror(errno));
+diff --git a/src/os_net/os_net.c b/src/os_net/os_net.c
+index f18e3be77..756e9fac8 100644
+--- a/src/os_net/os_net.c
++++ b/src/os_net/os_net.c
+@@ -14,7 +14,7 @@
+ #include <errno.h>
+ #include "shared.h"
+ #include "os_net.h"
+-agent *agt;
++agent *os_net_agt;
+ 
+ /* Prototypes */
+ static OSNetInfo *OS_Bindport(char *_port, unsigned int _proto, const char *_ip);
+@@ -346,11 +346,11 @@ int OS_Connect(char *_port, unsigned int protocol, const char *_ip)
+         return(OS_INVALID);
+     }
+ 
+-    if (agt) {
+-        if (agt->lip) {
++    if (os_net_agt) {
++        if (os_net_agt->lip) {
+             memset(&hints, 0, sizeof(struct addrinfo));
+             hints.ai_flags = AI_NUMERICHOST;
+-            s = getaddrinfo(agt->lip, NULL, &hints, &result);
++            s = getaddrinfo(os_net_agt->lip, NULL, &hints, &result);
+             if (s != 0) {
+                 verbose("getaddrinfo: %s", gai_strerror(s));
+             }
+@@ -363,8 +363,8 @@ int OS_Connect(char *_port, unsigned int protocol, const char *_ip)
+     memset(&hints, 0, sizeof(struct addrinfo));
+     /* Allow IPv4 or IPv6 if local_ip isn't specified */
+     hints.ai_family = AF_UNSPEC;
+-    if (agt) {
+-        if (agt->lip) {
++    if (os_net_agt) {
++        if (os_net_agt->lip) {
+             hints.ai_family = local_ai->ai_family;
+         }
+     }
+@@ -398,13 +398,13 @@ int OS_Connect(char *_port, unsigned int protocol, const char *_ip)
+             continue;
+         }
+ 
+-        if (agt) {
+-            if (agt->lip) {
++        if (os_net_agt) {
++            if (os_net_agt->lip) {
+                 if (bind(ossock, local_ai->ai_addr, local_ai->ai_addrlen)) {
+                     verbose("Unable to bind to local address %s.  Ignoring. (%s)",
+-                            agt->lip, strerror(errno));
++                            os_net_agt->lip, strerror(errno));
+                 }
+-                else verbose("Connecting from local address %s", agt->lip);
++                else verbose("Connecting from local address %s", os_net_agt->lip);
+             }
+         }
+ 
+diff --git a/src/os_net/os_net.h b/src/os_net/os_net.h
+index 9b7250928..3aaf00429 100644
+--- a/src/os_net/os_net.h
++++ b/src/os_net/os_net.h
+@@ -13,7 +13,7 @@
+ 
+ #include "headers/shared.h"
+ #include "config/client-config.h"
+-extern agent *agt;
++extern agent *os_net_agt;
+ #ifdef WIN32
+ #ifndef AI_ADDRCONFIG
+ #define AI_ADDRCONFIG   0x0400
+diff --git a/src/win32/win_agent.c b/src/win32/win_agent.c
+index 40a37e621..a2ec784f2 100644
+--- a/src/win32/win_agent.c
++++ b/src/win32/win_agent.c
+@@ -124,6 +124,7 @@ int local_start()
+     WSADATA wsaData;
+     DWORD  threadID;
+     DWORD  threadID2;
++    extern agent *agt;
+ 
+     /* Start agent */
+     agt = (agent *)calloc(1, sizeof(agent));
+@@ -271,6 +272,7 @@ int SendMSG(__attribute__((unused)) int queue, const char *message, const char *
+     char tmpstr[OS_MAXSTR + 2];
+     char crypt_msg[OS_MAXSTR + 2];
+     DWORD dwWaitResult;
++    extern agent *agt;
+ 
+     tmpstr[OS_MAXSTR + 1] = '\0';
+     crypt_msg[OS_MAXSTR + 1] = '\0';
+@@ -468,6 +470,8 @@ void send_win32_info(time_t curr_time)
+     tmp_msg[OS_MAXSTR + 1] = '\0';
+     crypt_msg[OS_MAXSTR + 1] = '\0';
+ 
++    extern agent *agt;
++
+     debug1("%s: DEBUG: Sending keep alive message.", ARGV0);
+ 
+     /* Fix time */

diff --git a/net-analyzer/ossec-hids/ossec-hids-3.6.0.ebuild b/net-analyzer/ossec-hids/ossec-hids-3.6.0.ebuild
index 7c416ed9c25..d305e7ce418 100644
--- a/net-analyzer/ossec-hids/ossec-hids-3.6.0.ebuild
+++ b/net-analyzer/ossec-hids/ossec-hids-3.6.0.ebuild
@@ -29,10 +29,17 @@ DEPEND="${RDEPEND}
 		dev-python/subunit
 	)"
 S="${WORKDIR}/${P}/src"
-PATCHES=( "${FILESDIR}/makefile-${PV}.patch" )
 
 declare -a MY_OPT
 
+src_prepare() {
+	# Patch for the GCC version 10 -fno-common change. See
+	# https://github.com/ossec/ossec-hids/pull/1875
+	eapply -p2 "${FILESDIR}/gcc-fno-common-${PV}.patch"
+	eapply -p1 "${FILESDIR}/makefile-${PV}.patch"
+	eapply_user
+}
+
 src_configure() {
 	local target="local"
 	use agent && target="agent"


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-04 17:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-30 10:27 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/ossec-hids/, net-analyzer/ossec-hids/files/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2019-07-05 17:30 Michał Górny
2020-06-04 17:05 Aaron Bauman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox