summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/daemon/CommLayerServerDBus.c1
-rw-r--r--src/daemon/Makefile.am2
-rw-r--r--src/daemon/MiddleWare.c1
-rw-r--r--src/daemon/abrt-action-save-package-data.c1
-rw-r--r--src/daemon/abrt-server.c14
-rw-r--r--src/daemon/abrtd.c2
-rw-r--r--src/hooks/CCpp.conf10
-rw-r--r--src/hooks/Makefile.am5
-rw-r--r--src/hooks/abrt-hook-ccpp.c35
-rw-r--r--src/include/abrtlib.h1
-rw-r--r--src/lib/Makefile.am1
-rw-r--r--src/lib/abrt_conf.c (renamed from src/daemon/abrt_conf.c)1
-rw-r--r--src/lib/abrt_conf.h (renamed from src/daemon/abrt_conf.h)15
-rw-r--r--src/lib/hash_sha1.h4
-rw-r--r--src/lib/hooklib.c72
-rw-r--r--src/lib/hooklib.h10
-rw-r--r--src/plugins/CCpp.conf37
-rw-r--r--src/plugins/Makefile.am1
18 files changed, 72 insertions, 141 deletions
diff --git a/src/daemon/CommLayerServerDBus.c b/src/daemon/CommLayerServerDBus.c
index dd03d989..05f7df92 100644
--- a/src/daemon/CommLayerServerDBus.c
+++ b/src/daemon/CommLayerServerDBus.c
@@ -21,7 +21,6 @@
#include "abrt_dbus.h"
#include "comm_layer_inner.h"
#include "MiddleWare.h"
-#include "abrt_conf.h"
#include "CommLayerServerDBus.h"
/*
diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am
index f57f85ff..6bb71b78 100644
--- a/src/daemon/Makefile.am
+++ b/src/daemon/Makefile.am
@@ -12,7 +12,6 @@ sbin_PROGRAMS = \
abrtd_SOURCES = \
MiddleWare.h MiddleWare.c \
CommLayerServerDBus.h CommLayerServerDBus.c \
- abrt_conf.h abrt_conf.c \
comm_layer_inner.h comm_layer_inner.c \
abrtd.c
abrtd_CPPFLAGS = \
@@ -75,7 +74,6 @@ abrt_handle_crashdump_LDADD = \
abrt_action_save_package_data_SOURCES = \
rpm.h rpm.c \
- abrt_conf.h abrt_conf.c \
abrt-action-save-package-data.c
abrt_action_save_package_data_CPPFLAGS = \
-I$(srcdir)/../include/report -I$(srcdir)/../include \
diff --git a/src/daemon/MiddleWare.c b/src/daemon/MiddleWare.c
index d337668f..fb943b1c 100644
--- a/src/daemon/MiddleWare.c
+++ b/src/daemon/MiddleWare.c
@@ -19,7 +19,6 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "abrtlib.h"
-#include "abrt_conf.h"
#include "comm_layer_inner.h"
#include "CommLayerServerDBus.h"
#include "MiddleWare.h"
diff --git a/src/daemon/abrt-action-save-package-data.c b/src/daemon/abrt-action-save-package-data.c
index af63ff2b..93350994 100644
--- a/src/daemon/abrt-action-save-package-data.c
+++ b/src/daemon/abrt-action-save-package-data.c
@@ -18,7 +18,6 @@
*/
#include <fnmatch.h>
#include "abrtlib.h"
-#include "abrt_conf.h"
#include "rpm.h"
#include "parse_options.h"
diff --git a/src/daemon/abrt-server.c b/src/daemon/abrt-server.c
index 4626d5de..53bb5fba 100644
--- a/src/daemon/abrt-server.c
+++ b/src/daemon/abrt-server.c
@@ -147,12 +147,16 @@ static void create_debug_dump()
log("Saved %s crash dump of pid %u to %s", analyzer, pid, path);
/* Trim old crash dumps if necessary */
- unsigned maxCrashReportsSize = 0;
- parse_conf(NULL, &maxCrashReportsSize, NULL, NULL);
- if (maxCrashReportsSize > 0)
+ load_abrt_conf();
+ free_abrt_conf_data(); /* can do this because we need only g_settings_nMaxCrashReportsSize */
+ /* x1.25: go a bit up, so that usual in-daemon trimming
+ * kicks in first, and we don't "fight" with it:
+ */
+ g_settings_nMaxCrashReportsSize += g_settings_nMaxCrashReportsSize / 4;
+ if (g_settings_nMaxCrashReportsSize > 0)
{
- check_free_space(maxCrashReportsSize);
- trim_debug_dumps(DEBUG_DUMPS_DIR, maxCrashReportsSize * (double)(1024*1024), path);
+ check_free_space(g_settings_nMaxCrashReportsSize);
+ trim_debug_dumps(DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize * (double)(1024*1024), path);
}
free(path);
diff --git a/src/daemon/abrtd.c b/src/daemon/abrtd.c
index 08c95f21..d18265f4 100644
--- a/src/daemon/abrtd.c
+++ b/src/daemon/abrtd.c
@@ -23,9 +23,9 @@
#include <syslog.h>
#include <sys/inotify.h>
#include <sys/ioctl.h> /* ioctl(FIONREAD) */
+
#include "abrtlib.h"
#include "comm_layer_inner.h"
-#include "abrt_conf.h"
#include "CommLayerServerDBus.h"
#include "MiddleWare.h"
#include "parse_options.h"
diff --git a/src/hooks/CCpp.conf b/src/hooks/CCpp.conf
new file mode 100644
index 00000000..a431c0c3
--- /dev/null
+++ b/src/hooks/CCpp.conf
@@ -0,0 +1,10 @@
+# Configuration file for CCpp hook
+Enabled = yes
+
+# If you also want to dump file named "core"
+# in crashed process' current dir, set to "yes"
+MakeCompatCore = yes
+
+# Do you want a copy of crashed binary be saved?
+# (useful, for example, when _deleted binary_ segfaults)
+SaveBinaryImage = no
diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am
index 66951f0f..cae22726 100644
--- a/src/hooks/Makefile.am
+++ b/src/hooks/Makefile.am
@@ -1,3 +1,8 @@
+pluginsconfdir = $(PLUGINS_CONF_DIR)
+
+dist_pluginsconf_DATA = \
+ CCpp.conf
+
libexec_PROGRAMS = abrt-hook-ccpp
# abrt-hook-ccpp
diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c
index d13851f3..84bbf4fa 100644
--- a/src/hooks/abrt-hook-ccpp.c
+++ b/src/hooks/abrt-hook-ccpp.c
@@ -390,11 +390,27 @@ int main(int argc, char** argv)
char *user_pwd = get_cwd(pid); /* may be NULL on error */
- /* Parse abrt.conf and plugins/CCpp.conf */
- unsigned setting_MaxCrashReportsSize = 0;
- bool setting_MakeCompatCore = false;
- bool setting_SaveBinaryImage = false;
- parse_conf(PLUGINS_CONF_DIR"/CCpp.conf", &setting_MaxCrashReportsSize, &setting_MakeCompatCore, &setting_SaveBinaryImage);
+ /* Parse abrt.conf */
+ load_abrt_conf();
+ free_abrt_conf_data(); /* can do this because we need only g_settings_nMaxCrashReportsSize */
+ /* x1.25: go a bit up, so that usual in-daemon trimming
+ * kicks in first, and we don't "fight" with it:
+ */
+ g_settings_nMaxCrashReportsSize += g_settings_nMaxCrashReportsSize / 4;
+ /* ... and plugins/CCpp.conf */
+ bool setting_MakeCompatCore;
+ bool setting_SaveBinaryImage;
+ {
+ map_string_h *settings = new_map_string();
+ load_conf_file(PLUGINS_CONF_DIR"/CCpp.conf", settings, /*skip key w/o values:*/ false);
+ char *value;
+ value = g_hash_table_lookup(settings, "MakeCompatCore");
+ setting_MakeCompatCore = value && string_to_bool(value);
+ value = g_hash_table_lookup(settings, "SaveBinaryImage");
+ setting_SaveBinaryImage = value && string_to_bool(value);
+ free_map_string(settings);
+ }
+
if (!setting_SaveBinaryImage && src_fd_binary >= 0)
{
close(src_fd_binary);
@@ -441,9 +457,10 @@ int main(int argc, char** argv)
goto create_user_core;
}
- if (setting_MaxCrashReportsSize > 0)
+ if (g_settings_nMaxCrashReportsSize > 0)
{
- check_free_space(setting_MaxCrashReportsSize);
+ g_settings_nMaxCrashReportsSize += g_settings_nMaxCrashReportsSize / 4;
+ check_free_space(g_settings_nMaxCrashReportsSize);
}
char path[PATH_MAX];
@@ -628,9 +645,9 @@ int main(int argc, char** argv)
free(newpath);
/* rhbz#539551: "abrt going crazy when crashing process is respawned" */
- if (setting_MaxCrashReportsSize > 0)
+ if (g_settings_nMaxCrashReportsSize > 0)
{
- trim_debug_dumps(DEBUG_DUMPS_DIR, setting_MaxCrashReportsSize * (double)(1024*1024), path);
+ trim_debug_dumps(DEBUG_DUMPS_DIR, g_settings_nMaxCrashReportsSize * (double)(1024*1024), path);
}
return 0;
diff --git a/src/include/abrtlib.h b/src/include/abrtlib.h
index e0014593..6d9337d5 100644
--- a/src/include/abrtlib.h
+++ b/src/include/abrtlib.h
@@ -83,6 +83,7 @@ int vdprintf(int d, const char *format, va_list ap);
#include "hooklib.h"
#include "run_event.h"
#include "event_config.h"
+#include "abrt_conf.h"
#ifdef __cplusplus
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index d2dc9cae..decfeffd 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -42,6 +42,7 @@ libreport_la_SOURCES = \
hooklib.c hooklib.h \
parse_release.c \
parse_options.c parse_options.h \
+ abrt_conf.c abrt_conf.h \
steal_directory.c \
event_xml_parser.c \
event_config.c
diff --git a/src/daemon/abrt_conf.c b/src/lib/abrt_conf.c
index 46d8f44c..2a1cf369 100644
--- a/src/daemon/abrt_conf.c
+++ b/src/lib/abrt_conf.c
@@ -17,7 +17,6 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "abrtlib.h"
-#include "abrt_conf.h"
bool g_settings_bOpenGPGCheck = false;
GList * g_settings_setOpenGPGPublicKeys = NULL;
diff --git a/src/daemon/abrt_conf.h b/src/lib/abrt_conf.h
index 2208e13a..2ca7542b 100644
--- a/src/daemon/abrt_conf.h
+++ b/src/lib/abrt_conf.h
@@ -16,24 +16,31 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef SETTINGS_H_
-#define SETTINGS_H_
-
-#include "abrt_types.h"
+#ifndef ABRT_CONF_H_
+#define ABRT_CONF_H_
#ifdef __cplusplus
extern "C" {
#endif
+#define g_settings_setOpenGPGPublicKeys abrt_g_settings_setOpenGPGPublicKeys
extern GList * g_settings_setOpenGPGPublicKeys;
+#define g_settings_setBlackListedPkgs abrt_g_settings_setBlackListedPkgs
extern GList * g_settings_setBlackListedPkgs;
+#define g_settings_setBlackListedPaths abrt_g_settings_setBlackListedPaths
extern GList * g_settings_setBlackListedPaths;
+#define g_settings_nMaxCrashReportsSize abrt_g_settings_nMaxCrashReportsSize
extern unsigned int g_settings_nMaxCrashReportsSize;
+#define g_settings_bOpenGPGCheck abrt_g_settings_bOpenGPGCheck
extern bool g_settings_bOpenGPGCheck;
+#define g_settings_bProcessUnpackaged abrt_g_settings_bProcessUnpackaged
extern bool g_settings_bProcessUnpackaged;
+#define g_settings_sWatchCrashdumpArchiveDir abrt_g_settings_sWatchCrashdumpArchiveDir
extern char * g_settings_sWatchCrashdumpArchiveDir;
+#define load_abrt_conf abrt_load_abrt_conf
int load_abrt_conf();
+#define free_abrt_conf_data abrt_free_abrt_conf_data
void free_abrt_conf_data();
#ifdef __cplusplus
diff --git a/src/lib/hash_sha1.h b/src/lib/hash_sha1.h
index 2b6b7606..850fd21f 100644
--- a/src/lib/hash_sha1.h
+++ b/src/lib/hash_sha1.h
@@ -17,6 +17,8 @@
*
* ---------------------------------------------------------------------------
*/
+#ifndef HASH_SHA1_H
+#define HASH_SHA1_H 1
#ifdef __cplusplus
extern "C" {
@@ -41,3 +43,5 @@ void sha1_end(sha1_ctx_t *ctx, void *resbuf);
#ifdef __cplusplus
}
#endif
+
+#endif
diff --git a/src/lib/hooklib.c b/src/lib/hooklib.c
index fd7ecc9a..3bde4dfa 100644
--- a/src/lib/hooklib.c
+++ b/src/lib/hooklib.c
@@ -19,78 +19,6 @@
#include "hooklib.h"
#include <sys/statvfs.h>
-void parse_conf(const char *additional_conf, unsigned *setting_MaxCrashReportsSize, bool *setting_MakeCompatCore, bool *setting_SaveBinaryImage)
-{
- FILE *fp = fopen(CONF_DIR"/abrt.conf", "r");
- if (!fp)
- return;
-
- while (1)
- {
- char *line = xmalloc_fgetline(fp);
- if (!line)
- {
- fclose(fp);
- if (additional_conf)
- {
- /* Next .conf file plz */
- fp = fopen(additional_conf, "r");
- if (fp)
- {
- additional_conf = NULL;
- continue;
- }
- }
- break;
- }
-
- const char *p = skip_whitespace(line);
-#undef DIRECTIVE
-#define DIRECTIVE "MaxCrashReportsSize"
- if (setting_MaxCrashReportsSize && strncmp(p, DIRECTIVE, sizeof(DIRECTIVE)-1) == 0)
- {
- p = skip_whitespace(p + sizeof(DIRECTIVE)-1);
- if (*p != '=')
- goto free_line;
- p = skip_whitespace(p + 1);
- if (isdigit(*p))
- {
- /* x1.25: go a bit up, so that usual in-daemon trimming
- * kicks in first, and we don't "fight" with it. */
- *setting_MaxCrashReportsSize = (unsigned long)xatou(p) * 5 / 4;
- }
- goto free_line;
- }
-#undef DIRECTIVE
-#define DIRECTIVE "MakeCompatCore"
- if (setting_MakeCompatCore && strncmp(p, DIRECTIVE, sizeof(DIRECTIVE)-1) == 0)
- {
- p = skip_whitespace(p + sizeof(DIRECTIVE)-1);
- if (*p != '=')
- goto free_line;
- p = skip_whitespace(p + 1);
- *setting_MakeCompatCore = string_to_bool(p);
- goto free_line;
- }
-#undef DIRECTIVE
-#define DIRECTIVE "SaveBinaryImage"
- if (setting_SaveBinaryImage && strncmp(p, DIRECTIVE, sizeof(DIRECTIVE)-1) == 0)
- {
- p = skip_whitespace(p + sizeof(DIRECTIVE)-1);
- if (*p != '=')
- goto free_line;
- p = skip_whitespace(p + 1);
- *setting_SaveBinaryImage = string_to_bool(p);
- goto free_line;
- }
-#undef DIRECTIVE
- /* add more 'if (strncmp(p, DIRECTIVE, sizeof(DIRECTIVE)-1) == 0)' here... */
-
- free_line:
- free(line);
- }
-}
-
void check_free_space(unsigned setting_MaxCrashReportsSize)
{
struct statvfs vfs;
diff --git a/src/lib/hooklib.h b/src/lib/hooklib.h
index a7421e06..c140f951 100644
--- a/src/lib/hooklib.h
+++ b/src/lib/hooklib.h
@@ -15,17 +15,13 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifndef HOOKLIB_H
+#define HOOKLIB_H 1
#ifdef __cplusplus
extern "C" {
#endif
-#define parse_conf abrt_parse_conf
-void parse_conf(const char *additional_conf,
- unsigned *setting_MaxCrashReportsSize,
- bool *setting_MakeCompatCore,
- bool *setting_SaveBinaryImage);
-
#define check_free_space abrt_check_free_space
void check_free_space(unsigned setting_MaxCrashReportsSize);
@@ -35,3 +31,5 @@ void trim_debug_dumps(const char *dirname, double cap_size, const char *exclude_
#ifdef __cplusplus
}
#endif
+
+#endif
diff --git a/src/plugins/CCpp.conf b/src/plugins/CCpp.conf
deleted file mode 100644
index bf66d86f..00000000
--- a/src/plugins/CCpp.conf
+++ /dev/null
@@ -1,37 +0,0 @@
-# Configuration file for CCpp hook and plugin
-Enabled = yes
-
-# If you also want to dump file named "core"
-# in crashed process' current dir, set to "yes"
-MakeCompatCore = yes
-
-# Do you want a copy of crashed binary be saved?
-# (useful, for example, when _deleted binary_ segfaults)
-SaveBinaryImage = no
-
-# Generate backtrace
-Backtrace = yes
-# How long to wait for gdb to finish. Default is 60 seconds.
-GdbTimeoutSec = 120
-
-# Generate backtrace for crashes uploaded from remote machines.
-# Note that for reliable backtrace generation, your local machine
-# needs to have the crashed executable and all libraries it uses,
-# and they need to be the same versions as on remote machines.
-# If you cannot ensure that, it's better to set this option to "no"
-BacktraceRemotes = no
-
-# How to get debuginfo: install, mount
-## install - download and install debuginfo packages
-## mount - mount fedora NFS with debug info
-## (IGNORED FOR NOW)
-DebugInfo = install
-
-# If this option is set to "yes",
-# debuginfos will be installed to @@LOCALSTATEDIR@@/cache/abrt-di
-InstallDebugInfo = yes
-
-# Additional directories to search for debuginfos.
-# For example, you can list a network-mounted shared store
-# of all debuginfos here.
-# ReadonlyLocalDebugInfoDirs = /path1:/path2:...
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index deec8e8e..00be78fd 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -25,7 +25,6 @@ bin_PROGRAMS = \
pluginsconfdir = $(PLUGINS_CONF_DIR)
dist_pluginsconf_DATA = \
- CCpp.conf \
Python.conf \
Kerneloops.conf \
Bugzilla.conf \