From 8bca7704c9e81427febf84606176caaed5dbafb4 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 6 Oct 2016 22:14:01 +0200 Subject: [PATCH] config: print default value for logging.audit --- configure.ac | 16 ++++++++-------- src/nm-audit-manager.c | 2 +- src/nm-config-data.c | 1 + src/nm-config.h | 4 +++- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 6f067c20d..717209310 100644 --- a/configure.ac +++ b/configure.ac @@ -524,16 +524,16 @@ else fi if test "$have_libaudit" = "yes"; then AC_DEFINE(HAVE_LIBAUDIT, 1, [Define if you have libaudit support]) - if test "$with_libaudit" = "yes-disabled-by-default"; then - AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, FALSE, [The default value of the logging.audit configuration option]) - NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false' - else - AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, TRUE, [The default value of the logging.audit configuration option]) - NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='true' - fi + if test "$with_libaudit" = "yes-disabled-by-default"; then + AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, "false", [The default value of the logging.audit configuration option]) + NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false' + else + AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, "true", [The default value of the logging.audit configuration option]) + NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='true' + fi else AC_DEFINE(HAVE_LIBAUDIT, 0, [Define if you have libaudit support]) - AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, FALSE, [The default value of the logging.audit configuration option]) + AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, "false", [The default value of the logging.audit configuration option]) NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false' fi AC_SUBST(NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT) diff --git a/src/nm-audit-manager.c b/src/nm-audit-manager.c index 384a5c3fb..c8bbc5ccc 100644 --- a/src/nm-audit-manager.c +++ b/src/nm-audit-manager.c @@ -336,7 +336,7 @@ init_auditd (NMAuditManager *self) if (nm_config_data_get_value_boolean (data, NM_CONFIG_KEYFILE_GROUP_LOGGING, NM_CONFIG_KEYFILE_KEY_AUDIT, - NM_CONFIG_DEFAULT_LOGGING_AUDIT)) { + NM_CONFIG_DEFAULT_LOGGING_AUDIT_BOOL)) { if (priv->auditd_fd < 0) { priv->auditd_fd = audit_open (); if (priv->auditd_fd < 0) diff --git a/src/nm-config-data.c b/src/nm-config-data.c index 73427d2a8..0875e69bd 100644 --- a/src/nm-config-data.c +++ b/src/nm-config-data.c @@ -544,6 +544,7 @@ static struct { { NM_CONFIG_KEYFILE_GROUP_MAIN, "rc-manager", NM_CONFIG_DEFAULT_DNS_RC_MANAGER }, { NM_CONFIG_KEYFILE_GROUP_MAIN, "auth-polkit", NM_CONFIG_DEFAULT_AUTH_POLKIT }, { NM_CONFIG_KEYFILE_GROUP_LOGGING, "backend", NM_CONFIG_LOGGING_BACKEND_DEFAULT }, + { NM_CONFIG_KEYFILE_GROUP_LOGGING, "audit", NM_CONFIG_DEFAULT_LOGGING_AUDIT }, }; void diff --git a/src/nm-config.h b/src/nm-config.h index bfa23e112..0d3faa883 100644 --- a/src/nm-config.h +++ b/src/nm-config.h @@ -182,7 +182,9 @@ extern char *_nm_config_match_env; /*****************************************************************************/ #define NM_CONFIG_DEVICE_STATE_DIR ""NMRUNDIR"/devices" -#define NM_CONFIG_DEFAULT_AUTH_POLKIT_BOOL (nm_streq0 (NM_CONFIG_DEFAULT_AUTH_POLKIT, "true")) + +#define NM_CONFIG_DEFAULT_AUTH_POLKIT_BOOL (nm_streq (""NM_CONFIG_DEFAULT_AUTH_POLKIT, "true")) +#define NM_CONFIG_DEFAULT_LOGGING_AUDIT_BOOL (nm_streq (""NM_CONFIG_DEFAULT_LOGGING_AUDIT, "true")) typedef enum { NM_CONFIG_DEVICE_STATE_MANAGED_TYPE_UNKNOWN = -1,