- related to trac#763, trac#768
Signed-off-by: Jakub Filak <[email protected]>
---
src/daemon/abrt.conf | 15 +++++++++++++++
src/include/libabrt.h | 4 ++++
src/lib/abrt_conf.c | 18 ++++++++++++++++++
3 files changed, 37 insertions(+)
diff --git a/src/daemon/abrt.conf b/src/daemon/abrt.conf
index c7ad417..6cc3376 100644
--- a/src/daemon/abrt.conf
+++ b/src/daemon/abrt.conf
@@ -20,3 +20,18 @@ MaxCrashReportsSize = 1000
# selinux policy.
#
DeleteUploaded = no
+
+# A name of event which is run automatically after problem's detection. The
+# event should perform some fast analysis and print out THANKYOU message if the
+# problem is konwn.
+#
+# In order to run this event automatically after detection, the
+# AutoreportingEnabled option must be configured to 'yes'
+#
+# Default value: report_uReport
+#
+AutoreportingEvent = report_uReport
+
+# Enables automatic running of the event configured in AutoreportingEvent
option.
+#
+AutoreportingEnabled = no
diff --git a/src/include/libabrt.h b/src/include/libabrt.h
index 7b6f236..34ae1ef 100644
--- a/src/include/libabrt.h
+++ b/src/include/libabrt.h
@@ -59,6 +59,10 @@ extern char * g_settings_sWatchCrashdumpArchiveDir;
extern char * g_settings_dump_location;
#define g_settings_delete_uploaded abrt_g_settings_delete_uploaded
extern bool g_settings_delete_uploaded;
+#define g_settings_autoreporting abrt_g_settings_autoreporting
+extern bool g_settings_autoreporting;
+#define g_settings_autoreporting_event abrt_g_settings_autoreporting_event
+extern char * g_settings_autoreporting_event;
#define load_abrt_conf abrt_load_abrt_conf
diff --git a/src/lib/abrt_conf.c b/src/lib/abrt_conf.c
index 0b53c21..9774f6b 100644
--- a/src/lib/abrt_conf.c
+++ b/src/lib/abrt_conf.c
@@ -22,6 +22,8 @@ char * g_settings_sWatchCrashdumpArchiveDir = NULL;
unsigned int g_settings_nMaxCrashReportsSize = 1000;
char * g_settings_dump_location = NULL;
bool g_settings_delete_uploaded = 0;
+bool g_settings_autoreporting = 0;
+char * g_settings_autoreporting_event = NULL;
void free_abrt_conf_data()
{
@@ -72,6 +74,22 @@ static void ParseCommon(map_string_h *settings, const char
*conf_filename)
g_hash_table_remove(settings, "DeleteUploaded");
}
+ value = g_hash_table_lookup(settings, "AutoreportingEnabled");
+ if (value)
+ {
+ g_settings_autoreporting = string_to_bool(value);
+ g_hash_table_remove(settings, "AutoreportingEnabled");
+ }
+
+ value = g_hash_table_lookup(settings, "AutoreportingEvent");
+ if (value)
+ {
+ g_settings_autoreporting_event = xstrdup(value);
+ g_hash_table_remove(settings, "AutoreportingEvent");
+ }
+ else
+ g_settings_autoreporting_event = xstrdup("report_uReport");
+
GHashTableIter iter;
char *name;
/*char *value; - already declared */
--
1.7.11.7