Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #21586: rudder agent fails to build #2653

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff --color -ruN cfengine-source.old/libntech/libutils/logging.c cfengine-source/libntech/libutils/logging.c
--- cfengine-source.old/libntech/libutils/logging.c 2021-12-16 22:26:53.392432302 +0100
+++ cfengine-source/libntech/libutils/logging.c 2021-12-16 22:29:47.273755076 +0100
@@ -31,6 +31,7 @@
diff --color -ruN cfengine-core.old/libntech/libutils/logging.c cfengine-core/libntech/libutils/logging.c
--- cfengine-core.old/libntech/libutils/logging.c 2022-08-10 09:24:55.219272530 +0200
+++ cfengine-core/libntech/libutils/logging.c 2022-08-10 09:25:10.535277405 +0200
@@ -32,6 +32,7 @@
#include <definitions.h> /* CF_BUFSIZE */

char VPREFIX[1024] = ""; /* GLOBAL_C */
+bool USE_SYSLOG = true;

static char AgentType[80] = "generic";
static bool TIMESTAMPS = false;
@@ -261,8 +262,10 @@
@@ -276,8 +277,10 @@
void LogToSystemLog(const char *msg, LogLevel level)
{
char logmsg[4096];
Expand All @@ -21,28 +21,28 @@ diff --color -ruN cfengine-source.old/libntech/libutils/logging.c cfengine-sourc
+ }
}
#endif /* !__MINGW32__ */

diff --color -ruN cfengine-source.old/libpromises/generic_agent.c cfengine-source/libpromises/generic_agent.c
--- cfengine-source.old/libpromises/generic_agent.c 2021-12-16 22:26:53.364431978 +0100
+++ cfengine-source/libpromises/generic_agent.c 2021-12-16 22:29:35.941706989 +0100
diff --color -ruN cfengine-core.old/libpromises/generic_agent.c cfengine-core/libpromises/generic_agent.c
--- cfengine-core.old/libpromises/generic_agent.c 2022-08-10 09:24:45.743269573 +0200
+++ cfengine-core/libpromises/generic_agent.c 2022-08-10 09:25:31.711284340 +0200
@@ -81,6 +81,8 @@
#define AUGMENTS_CLASSES_REGULAR_EXPRESSIONS "regular_expressions"
#define AUGMENTS_COMMENT_KEY "comment"

+extern bool USE_SYSLOG;
+
static pthread_once_t pid_cleanup_once = PTHREAD_ONCE_INIT; /* GLOBAL_T */

static char PIDFILE[CF_BUFSIZE] = ""; /* GLOBAL_C */
@@ -2098,11 +2100,14 @@
@@ -2132,11 +2134,14 @@
Log(LOG_LEVEL_VERBOSE, "SET Syslog FACILITY = %s", retval);

CloseLog();
- OpenLog(ParseFacility(retval));
- SetSyslogFacility(ParseFacility(retval));
- if (!StoreDefaultLogFacility())
- {
+ if(strcmp(retval == "NONE")==0) {
+ if(strcmp(retval, "NONE")==0) {
+ USE_SYSLOG = false;
+ } else {
+ OpenLog(ParseFacility(retval));
Expand All @@ -52,16 +52,16 @@ diff --color -ruN cfengine-source.old/libpromises/generic_agent.c cfengine-sourc
+ }
}
}

diff --color -ruN cfengine-source.old/libpromises/mod_common.c cfengine-source/libpromises/mod_common.c
--- cfengine-source.old/libpromises/mod_common.c 2021-12-16 22:26:53.384432209 +0100
+++ cfengine-source/libpromises/mod_common.c 2021-12-16 22:27:02.384534617 +0100
diff --color -ruN cfengine-core.old/libpromises/mod_common.c cfengine-core/libpromises/mod_common.c
--- cfengine-core.old/libpromises/mod_common.c 2022-08-10 09:24:45.743269573 +0200
+++ cfengine-core/libpromises/mod_common.c 2022-08-10 09:25:10.535277405 +0200
@@ -48,7 +48,7 @@
#include <syntax.h>

#define CF_LOGRANGE "stdout|udp_syslog|(\042?[a-zA-Z]:\\\\.*)|(/.*)"
-#define CF_FACILITY "LOG_USER,LOG_DAEMON,LOG_LOCAL0,LOG_LOCAL1,LOG_LOCAL2,LOG_LOCAL3,LOG_LOCAL4,LOG_LOCAL5,LOG_LOCAL6,LOG_LOCAL7"
+#define CF_FACILITY "LOG_USER,LOG_DAEMON,LOG_LOCAL0,LOG_LOCAL1,LOG_LOCAL2,LOG_LOCAL3,LOG_LOCAL4,LOG_LOCAL5,LOG_LOCAL6,LOG_LOCAL7,NONE"

static const char *const POLICY_ERROR_VARS_CONSTRAINT_DUPLICATE_TYPE =
"Variable contains existing data type contstraint %s, tried to "