This makes the package buildable. I have a version of the patches
combined with a 3.6.0 upgrade. Since I don't use the package, I don't
want to install it to figure out if something would be broken
post-build. I'll push the patches upstream separately.

>From 884278196c713f93efe6c3e657e3b2008d2e3641 Mon Sep 17 00:00:00 2001
From: Greg Steuck <g...@lenny.nest.cx>
Date: Sat, 27 Feb 2021 22:12:41 -0800
Subject: [PATCH] Fix -fno-common bugs in security/ossec-hids

---
 security/ossec-hids/Makefile                  |  2 +-
 .../patches/patch-src_addagent_main_c         | 24 +++++++++++++++++++
 .../patch-src_addagent_manage_agents_h        | 13 ++++++++++
 .../patches/patch-src_client-agent_config_c   | 15 ++++++++++++
 4 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 security/ossec-hids/patches/patch-src_addagent_main_c
 create mode 100644 
security/ossec-hids/patches/patch-src_addagent_manage_agents_h
 create mode 100644 security/ossec-hids/patches/patch-src_client-agent_config_c

diff --git a/security/ossec-hids/Makefile b/security/ossec-hids/Makefile
index be1e14ea8cc..a955dc71992 100644
--- a/security/ossec-hids/Makefile
+++ b/security/ossec-hids/Makefile
@@ -5,7 +5,7 @@ COMMENT =       host-based intrusion detection system
 GH_ACCOUNT =   ossec
 GH_PROJECT =   ossec-hids
 GH_TAGNAME =   3.0.0
-REVISION =     1
+REVISION =     2
 
 CATEGORIES =   security
 
diff --git a/security/ossec-hids/patches/patch-src_addagent_main_c 
b/security/ossec-hids/patches/patch-src_addagent_main_c
new file mode 100644
index 00000000000..65c3b4edfb6
--- /dev/null
+++ b/security/ossec-hids/patches/patch-src_addagent_main_c
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+-fno-common
+
+Index: src/addagent/main.c
+--- src/addagent/main.c.orig
++++ src/addagent/main.c
+@@ -84,6 +84,8 @@ static void manage_shutdown(__attribute__((unused)) in
+ }
+ #endif
+ 
++int willchroot;
++
+ int main(int argc, char **argv)
+ {
+     char *user_msg;
+@@ -104,7 +106,6 @@ int main(int argc, char **argv)
+     int ret;
+ #endif
+ 
+-    extern int willchroot;
+     willchroot = 1;
+ 
+     /* Set the name */
diff --git a/security/ossec-hids/patches/patch-src_addagent_manage_agents_h 
b/security/ossec-hids/patches/patch-src_addagent_manage_agents_h
new file mode 100644
index 00000000000..36782067c0a
--- /dev/null
+++ b/security/ossec-hids/patches/patch-src_addagent_manage_agents_h
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+-fno-common
+
+Index: src/addagent/manage_agents.h
+--- src/addagent/manage_agents.h.orig
++++ 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;
++extern int willchroot;
diff --git a/security/ossec-hids/patches/patch-src_client-agent_config_c 
b/security/ossec-hids/patches/patch-src_client-agent_config_c
new file mode 100644
index 00000000000..b466a41aeaa
--- /dev/null
+++ b/security/ossec-hids/patches/patch-src_client-agent_config_c
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+-fno-common
+
+Index: src/client-agent/config.c
+--- src/client-agent/config.c.orig
++++ src/client-agent/config.c
+@@ -17,7 +17,6 @@
+ time_t available_server;
+ int run_foreground;
+ keystore keys;
+-agent *agt;
+ 
+ 
+ /* Read the config file (for the remote client) */
-- 
2.30.1

Reply via email to